Por Newtonnotwen, 09 de ago. de 2012 em Actions e Talkactions
info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80
Esse script cria tiles no chão.
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,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
else
doCreateItem(id, 1, pos)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
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):
-Vermelho: Id do item
-Verde: Posição (x,y,z)
Ex:
local id,pos,x = 1284,{x=1023, y=1017, z=8},true
local id,pos,x = 1284,{x=1024, y=1017, z=8},true
local id,pos,x = 1284,{x=1025, y=1017, z=8},true
local id,pos,x = 1284,{x=1026, y=1017, z=8},true
-Laranja: Parte adicionada
Adicionando no RME:
Imagem:
Antes:
Depois:
Editado Agosto 17 por Newtonnotwen
info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80
Esse script cria tiles no chão.
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,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
else
doCreateItem(id, 1, pos)
end
local id,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
else
doCreateItem(id, 1, pos)
end
local id,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
else
doCreateItem(id, 1, pos)
end
local id,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
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,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
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,id2,pos,x = 1284,1284,{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)
doCreateItem(id2, 1, pos)
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:
Imagem:
Antes:
Depois:
Editado Agosto 17 por Newtonnotwen