Postado Janeiro 17, 2020 5 anos Autor 3 horas atrás, Vodkart disse: dá para fazer tudo num script só. 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 = { -- [ITEMID] [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.itemid] 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 ID DOS ITEMS QUE ESTÃO DENTRO DAS CHAVES [] local items = { -- [ITEMID] [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 itemid="15872;15873;15874" script="nome do seu script.lua"/> ou se forem tudo em ordem tbm pode ser assim: <action itemid="15872-15874" script="nome do seu script.lua"/> Desculpa, mais esqueci de dizer que não é item, e sim um objeto no mapa, no caso uniqueid ou actionid!
Postado Janeiro 17, 2020 5 anos Solução @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"/> [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Janeiro 17, 2020 5 anos Autor 54 minutos atrás, Vodkart disse: @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"/> Show!! REP++ Melhor comentário!! Obrigado de verdade! Só uma duvida! sabe a nave quando clicar no item tem como coloca uma script de uma nave com o cara dentro saindo! como se tivesse viajando!? SO UMA DUVIDA MESMO!
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.