Abra actions.xml e adicione:
<action actionid="4876" script="dotile.lua"/>
Agora em data/actions/scripts crie um arquivo chamado dotile.lua e adicione:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local id,pos,x = 1284,{x=1023, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = 1284,{x=1024, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = 1284,{x=1025, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = 1284,{x=1026, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end
Editando:
-Vermelho: Id do tile
-Verde: Localização do tile
Para adicionar mais posições faça o seguinte:
Adicione o seguinte arquivo antes de doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945):
local id,pos,x = ITEM,{x=POS, y=POS, z=POS},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
Editando:
-Vermelho: Id do item
-Verde: Posição (x,y,z)
Ex:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local id,pos,x = 1284,{x=1023, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = 1284,{x=1024, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = 1284,{x=1025, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = 1284,{x=1026, y=1017, z=8},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
local id,pos,x = ITEM,{x=POS, y=POS, z=POS},true
if getTileItemById(pos, id).uid == 0 then x = false end
if x == true then
doRemoveItem(getThingfromPos(pos).uid,1)
else
doCreateItem(id, 1, pos)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end
-Laranja: Parte adicionada
Adicionando no RME:





info
Grupo: Campones
Registrado: 26/06/10
Posts: 16
Reputação: 0
[9.10][Pedido][Action]
Queria um script que quando eu dou USE na Alavanca aparece vários tiles (ID 1284) em várias posições (x=1023 y=1017 z=8, x=1024 y=1017 z=8, x=1025 y=1017 z=8, x=1026 y=1017 z=8) que seja facilmente configurável para adicionar/remover novas posições e diferentes tiles.