This is my script, it removes a walls on certain time and then add again, the problem is that there is a stair i want it to transform into a white tile and then into the stair again. When i pull the switch all works except to transform the stairs into the tile.
Please help me.
Please help me.
Code:
function onUse(cid, item, frompos, item2, topos)
local minutes = 0
local seconds = 30
stone1 = {x=208, y=209, z=3, stackpos=1}
getstone1 = getThingfromPos(stone1)
stone2 = {x=208, y=207, z=3, stackpos=1}
getstone2 = getThingfromPos(stone2)
stone3 = {x=210, y=206, z=3, stackpos=1}
getstone3 = getThingfromPos(stone3)
stone4 = {x=213, y=206, z=3, stackpos=1}
getstone4 = getThingfromPos(stone4)
stone5 = {x=212, y=208, z=3, stackpos=1}
getstone5 = getThingfromPos(stone5)
if item.actionid == 7000 and item.itemid == 1945 then
doRemoveItem(getstone1.uid,1)
doRemoveItem(getstone2.uid,1)
doRemoveItem(getstone3.uid,1)
doRemoveItem(getstone4.uid,1)
doTransformItem(getstone5.uid,1)
doCreateItem(406,1,stone5)
addEvent(timeToPas,(1000*60*minutes) + (1000*seconds))
else
doPlayerSendTextMessage(cid, 22, 'You already switched the tile.')
end
end
function timeToPas()
doCreateItem(1025,1,stone1)
doCreateItem(1025,1,stone2)
doCreateItem(1026,1,stone3)
doCreateItem(1026,1,stone4)
doCreateItem(4835,1,stone5)
return TRUE
end