Loremaster7
New Member
- Joined
- Oct 16, 2017
- Messages
- 29
- Reaction score
- 4
In my code, clicking on the lever removes a stone, and the stone comes back in 10 seconds, but if you keep clicking on the lever an error occurs, I would need the lever works again only after 10 seconds. if the player clicks before 10 seconds the lever would not perform any function.
(my distro is The OTX Server Version: (2.X.S - 4) Otserver 7.72)
My Code:
(my distro is The OTX Server Version: (2.X.S - 4) Otserver 7.72)
My Code:
Lua:
local time = 10
local stone_pos = {x = 2895, y = 2687, z = 8, stackpos=1}
function onUse(cid, item, frompos, item2, topos)
stone = getThingfromPos(stone_pos)
if item.uid == 60116 and item.itemid == 1945 then
doRemoveItem(stone.uid,1304)
doTransformItem(item.uid,item.itemid+1)
addEvent(function()
local stone = doCreateItem(1304, 1, stone_pos)
end, time * 1000)
if item.uid == 60116 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
end
return true
end
end
Last edited: