I have just started with lua and I have no idea if this will work (it is my first):
Will it work?
If not, what did I do wrong?
I don't really know about that exhaust. Is there a better way to do it? (cooldown 60 min)
PHP:
dofile(getDataDir() .. "lib/exhaustion.lua")
local item = 2263
local time = 10
local town = getPlayerMasterPos(cid)
local exhausttime = 60 * 60 * 1000
local storevalue = 4850
function onUse(cid, item, frompos, item2, topos)
if item.itemid == item and isPlayerPzLocked(cid) == FALSE and (exhaust(cid, storevalue, exhausttime) == 1) then
doPlayerSendTextMessage(cid,"You will be teleported to your home town in 10 seconds!",19)
function teleportTimer(cid)
doTeleportThing(cid, town, 1)
addEvent(teleportTimer, (time * 1000)
else
doPlayerSendTextMessage(cid,"You are pz locked",19)
end
return TRUE
end
end
If not, what did I do wrong?
I don't really know about that exhaust. Is there a better way to do it? (cooldown 60 min)
Last edited: