posting on here to for help
ok.. i have a script that summons a demon when you pull the lever, only issue is i want to add a timer to it so people cant abuse it.
heres the working script
now heres the edit i tried to do to add a timer:
thats how far it got to at least make the script working to summon. the error that i get with this is the item comes up as a nil value
i'm pretty sure i'm missing something and i most likely did a backwards screwy way to get what i did. pretty new to scripting these things still.
any help is appreciated and of course rep+ to those that help out
thanks in advanced
ok.. i have a script that summons a demon when you pull the lever, only issue is i want to add a timer to it so people cant abuse it.
heres the working script
Code:
local pos = {x=608, y=602, z=10}
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1945 and item.uid == 2002 then
doSummonCreature("demon", pos)
return TRUE
end
end
Code:
local pos = {x=608, y=602, z=10}
function onUse(cid, item, frompos, item2, topos)
timetoreset = 20000 -- enter another time, 20 secs now
if item.itemid == 1945 and item.uid == 2002 then
doSummonCreature("demon", pos)
addEvent(callback, timetoreset)
return TRUE
end
end
function callback(timetoreset)
if item.itemid ~= 0 then
doTransformItem(item.uid, 1945)
return 1
end
end
i'm pretty sure i'm missing something and i most likely did a backwards screwy way to get what i did. pretty new to scripting these things still.
any help is appreciated and of course rep+ to those that help out
thanks in advanced