I want to introduce exhausted of 5 seconds to this script 
scroll.lua
Actions.xml
scroll.lua
Code:
local teleport = {
pos = {x = 163, y = 52, z = 7},
effect = 12,
effecto = 50,
remove = 0, -- Si quieres que se remueva el item (0 = NO, 1 = SI)
delay = 3
}
local function doTeleport(cid,delay,frompos,topos)
if delay == 0 then
doSendMagicEffect(frompos,12)
doTeleportThing(cid, topos)
doSendMagicEffect(topos,teleport.effecto)
else
doCreatureSay(cid, "Tp en... "..delay.." ", TALKTYPE_ORANGE_1)
doSendMagicEffect(frompos,12)
addEvent(doTeleport,1000,cid,(delay - 1),frompos,topos)
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getCreatureSkullType(cid) >= 3 then
doPlayerSendCancel(cid, "Ustes esta pk.")
doSendMagicEffect(getCreaturePosition(cid),2)
return false
end
if hasCondition(cid,CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Tiene pz.")
doSendMagicEffect(getCreaturePosition(cid),2)
return false
end
if teleport.remove == 1 then
doRemoveItem(item.uid, 1)
end
doCreatureSay(cid, "Preparandose para tp en... "..teleport.delay.." ", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid),teleport.effect)
addEvent(doTeleport,1000,cid,(teleport.delay - 1),getCreaturePosition(cid),teleport.pos)
return true
end
Actions.xml
Code:
<action itemid="5809" event="script" value="Zero/scroll.lua"/>