local config = {
toKnow = 456789,
storage = 789456,
pos = {x = 402, y = 907, z = 7}, -- para onde o jogador será teleportado caso o tempo tenha acabado.
}
local function kickP(cid)
if(isPlayer(cid)) then
doRemoveCreature(cid)
end
end
function onKill(cid, target, lastHit)
if getPlayerStorageValue (cid, config.toKnow) == 1 then
if getPlayerStorageValue (cid, config.storage) < os.time () then
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doRemoveCreature (cid)
end
end
return true
end
function onThink(cid, interval)
if getPlayerStorageValue (cid, config.toKnow) == 1 and getPlayerStorageValue (cid, config.storage) < os.time () then
addEvent(kickP, 3000, cid) -- 3000 = 3 segundos.
end
return true
end
function onLogin(cid)
if getPlayerStorageValue (cid, config.toKnow) == 1 then
if getPlayerStorageValue (cid, config.storage) < os.time () then
doTeleportThing (cid, config.pos)
setPlayerStorageValue (cid, config.toKnow, 0)
end
end
return true
end
nova tag XML
<event type="think" name="Kickp" event="script" value="NOME_DO_SCRIPT.lua"/>