Exmortis
Member
- Joined
- Jun 27, 2008
- Messages
- 189
- Reaction score
- 5
Alright so i'm trying to get this script working for my TFS 0.2.7 server and i dont know what i've done work but the timer isnt working.
Its supposed to be that you put an object on a platform and then pull a lever which removes a door/stone. Then after say like 5-10 seconds, the scripts resets and the stone is there again.
What have i done wrong?
Script:
Its supposed to be that you put an object on a platform and then pull a lever which removes a door/stone. Then after say like 5-10 seconds, the scripts resets and the stone is there again.
What have i done wrong?
Script:
Code:
function onUse(cid, item, frompos, item2, topos)
local switchUniqueID = 65535 -- uniqueID of switch
local switchID = 1945
local switch2ID = 1946
local itemID = 9734
local itempos = {x=1006, y=1086, z=7, stackpos=1}
local wallpos = {x=1005, y=1085, z=7, stackpos=1}
local playername = getPlayerName(cid)
local getitem = getThingfromPos(itempos)
local wallchk = getThingfromPos(wallpos)
if item.uid == switchUniqueID and item.itemid == switchID and getitem.itemid == itemID and wallchk.itemid == 3700 then
doSendMagicEffect(itempos,10)
doSendMagicEffect(wallchk,10)
doRemoveItem(getitem.uid,1)
doRemoveItem(wallchk.uid,1)
doTransformItem(item.uid,item.itemid+1)
addEvent(onTimer5, 5)
elseif item.uid == switchUniqueID and item.itemid == switch2ID then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"You need to place the potion of the slain Guard.")
end
return 1
end
function onTimer5()
wallnewpos = {x=1005, y=1085, z=7}
doCreateItem(3700,1,wallnewpos)
end
Last edited: