@isac001 de boa, vamos por por actionID então!!
function doTpTime(cid, delay, pos, msg)
if not isCreature(cid) then return LUA_ERROR end
if delay > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "{Teleport} "..delay.." segundos para se teletransportar para "..msg..".")
addEvent(doTpTime, 1000, cid, delay-1, pos, msg)
else
doTeleportThing(cid, pos)
doSendMagicEffect(getPlayerPosition(cid), 10)
doPlayerSendTextMessage(cid, 22, "Voce foi teleportado para "..msg.."! DBO EVOLUTION")
end
end
local store,exhausted = 756841,10
function onUse(cid, item, fromPosition, item2, toPosition)
local items = { -- [actionID]
[15872] = {pos = {x = 433, y = 992, z = 15}, msg = "Earth"},
[15873] = {pos = {x = 478, y = 992, z = 15}, msg = "Namek Planet"},
[15874] = {pos = {x = 500, y = 992, z = 15}, msg = "Vegeta Planet"}
}
local var = items[item.actionid]
if not var then return true end
if getPlayerStorageValue(cid, store) >= os.time() then
doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this item.") return true
end
setPlayerStorageValue(cid, store, os.time()+exhausted)
doTpTime(cid, 5, var.pos, var.msg)
return true
end
FAVOR TROCAR O ACTIONID QUE ESTÃO DENTRO DAS CHAVES []
local items = { -- [ACTIONID]
[15872] = {pos = {x = 433, y = 992, z = 15}, msg = "Earth"},
[15873] = {pos = {x = 478, y = 992, z = 15}, msg = "Namek Planet"},
[15874] = {pos = {x = 500, y = 992, z = 15}, msg = "Vegeta Planet"}
}
ai no actions.xml coloca assim por exemplo:
<action actionid="15872;15873;15874" script="nome do seu script.lua"/>
ou se forem tudo em ordem os actionID, tbm pode ser assim:
<action actionid="15872-15874" script="nome do seu script.lua"/>