Postado Julho 3, 2014 10 anos Autor local tempo = 30 local storage, exhaust = 94360, 5 function onSay(cid, words, param, condition, channel) if not getCreatureCondition(cid, CONDITION_INFIGHT) then if (getPlayerStorageValue(cid, storage) <= os.time()) then doTeleportThing(cid, {x=1053, y=1054, z=7}) doPlayerSendTextMessage(cid,22, "Voce foi teleportado para o CP") setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Voce so pode usar o comando daqui a "..exhaust.." segundos") end end return true end Só aparece uma msg de erro no console se estiver em battle: [03/07/2014 18:14:11] [Error - TalkAction Interface] [03/07/2014 18:14:11] In a timer event called from: [03/07/2014 18:14:11] data/talkactions/scripts/teleportcp.lua [03/07/2014 18:14:11] Description: [03/07/2014 18:14:11] attempt to call a nil value [03/07/2014 18:14:11] stack traceback: Percebi que foi retirado a msg quando o player estiver em battle. O exaust funciona mas se estiver em batle aparece esse erro ai em cima. @Viiting O seu script funciona tb, porem se o player estiver em batle ele usa a storage do mesmo geito e não é teleportado e o exaust do player buga, o tempo nao acaba nunca. E se o player não usar em batle aparece a msg de 30 segundos de exaust, passando 15 segundos se ele usar o comando novamente aparece a msg dos 30 segundos, o tempo vai diminuindo mas a msg sempre é de 30 segundos. Editado Julho 3, 2014 10 anos por Duduph (veja o histórico de edições) http://pokedg.servegame.com:8090 https://www.facebook.com/pokedg https://www.facebook.com/groups/pokedg/
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.