Postado Setembro 17, 2017 7 anos Em movements/scripts crie um arquivo: tpmensal.lua Spoiler local newpos = {x = 1, y = 1, z = 1} -- posição que o teleport levará local time = {30, "day"} -- tempo para entrar novamente function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getPlayerStorageValue(cid, 43445) >= os.time() then doPlayerSendCancel(cid, "You can enter again at " .. os.date("%d %B %Y %X", getPlayerStorageValue(cid, 43445))..".") doTeleportThing(cid, fromPosition) return true end setPlayerStorageValue(cid, 43445, mathtime(time) + os.time()) doTeleportThing(cid, newpos) doSendMagicEffect(newpos, CONST_ME_TELEPORT) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end return "Error: Bad declaration in mathtime function." end Em movements.xml: <movevent type="StepIn" actionid="ACTION_ID_DO_TELEPORT" event="script" value="tpmensal.lua"/> Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Setembro 17, 2017 7 anos Autor 56 minutos atrás, Dwarfer disse: Em movements/scripts crie um arquivo: tpmensal.lua Ocultar conteúdo local newpos = {x = 1, y = 1, z = 1} -- posição que o teleport levará local time = {30, "day"} -- tempo para entrar novamente function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getPlayerStorageValue(cid, 43445) >= os.time() then doPlayerSendCancel(cid, "You can enter again at " .. os.date("%d %B %Y %X", getPlayerStorageValue(cid, 43445))..".") doTeleportThing(cid, fromPosition) return true end setPlayerStorageValue(cid, 43445, mathtime(time) + os.time()) doTeleportThing(cid, newpos) doSendMagicEffect(newpos, CONST_ME_TELEPORT) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1) end end return "Error: Bad declaration in mathtime function." end Em movements.xml: <movevent type="StepIn" actionid="ACTION_ID_DO_TELEPORT" event="script" value="tpmensal.lua"/> Funcionou perfeitamente, obrigado
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.