HamTheKratos
Member
Hello.. ^^ Wish It Helps You
CREDITS:Thrown
movements.xml:
tilestep.lua:
actions.xml:
tiledoor.lua:
How It Works?
when a player step on a tile he gets access to open certin door.
Where To Use It?
you can make that tile in a far place from the door as alone quest or just need the door.
how to edit the place of the door and the tile?
make the door unique id 40002.
make the tile action id 40001.
please comment and rep
CREDITS:Thrown
movements.xml:
Lua:
<movement type="StepIn" actionid="40001" event="script" value="tilestep.lua"/>
tilestep.lua:
Lua:
function onStepIn(cid, item, pos)
if item.itemid == 4415 and item.uid == 40001 then
if getPlayerStorageValue(cid,40002) == -1 then
setPlayerStorageValue(cid,40002,1)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You may now open the door.')
end
return 1
end
end
actions.xml:
Lua:
<action uniqueid="40002" script="tiledoor.lua" />
tiledoor.lua:
Lua:
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 9175 and item.uid == 40002 then
if getPlayerStorageValue(cid,40002) == 1 then
pos = getPlayerPosition(cid)
doTransformItem(item.uid,item.itemid+1)
playerpos = getPlayerPosition(cid)
doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}
if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then
doMoveCreature(cid, 1)
elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 2)
elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then
doMoveCreature(cid, 3)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 4)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 5)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 6)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 7)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,'You need to step on a tile before opening this door.')
end
return 1
end
end
How It Works?
when a player step on a tile he gets access to open certin door.
Where To Use It?
you can make that tile in a far place from the door as alone quest or just need the door.
how to edit the place of the door and the tile?
make the door unique id 40002.
make the tile action id 40001.
please comment and rep
Last edited: