tpscroll.lua
Kod:
-- By Xemorin --
function onUse(cid, item, fromPosition, itemEx, toPosition)
local town = getTownTemplePosition(getPlayerTown(cid))
local time = 5 -- ile sekund nalezy odczekac po kazdym uzyciu
local storage = 6353
if (not getCreatureCondition(cid, 1024)) and (getCreatureSkullType(cid) == 0) then
if not exhaustion.check(cid, storage) then
exhaustion.set(cid, storage, time)
doTeleportThing(cid, town)
doSendMagicEffect(town, 40)
doCreatureSay(cid, "Witamy w temple!", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid,"Musisz poczekac "..time.." sekund by znow sie teleportowac.")
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
end
else
doPlayerSendCancel(cid,"Nie mozesz miec zadnej czaski lub byc w czasie walki!")
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
end
return true
end
Kod:
<action itemid="id_itemu" event="script" value="tpscroll.lua"/>
Zakładki