Postado Junho 11, 2016 9 anos Olá!, eu uso esse script aqui para a talkaction de rainbow outfit, que para quem nao sabe, é um script onde fica trocando as cores do outfit enlouquecidamente: local colors = {94, 81, 79, 88, 18, 11, 92, 128} local storage = 65535 local time = 10 --in miliseconds function onSay(cid, words, param, channel) if(param == "on") then if getPlayerStorageValue(cid, storage) < 1 then if doPlayerRemoveMoney(cid, 0) == TRUE then local event = addEvent(changeOutfit, time, cid) setPlayerStorageValue(cid, storage, 1) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have enough money.") return TRUE end else return TRUE end elseif(param == "off") then if getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, 0) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have rainbow outfit on.") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use !rainbow on-off.") return TRUE end return TRUE end function changeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(repeatChangeOutfit, time, cid) return TRUE else stopEvent(event) return TRUE end end function repeatChangeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(changeOutfit, time, cid) return TRUE else stopEvent(event) return TRUE end end Mas ocorre um bug ao deslogar: Além disso, ocorre outro erro também: se qualquer bicho faz o player trocar de outfit (como serpent spawn faz virar worm), buga o char da pessoa que ao dar change outfit da debug. Teria de alguma maneira como fazer resetar essa parada ao deslogar voltar pro outfit normal? ou qualquer outfit já existente. só pra nao dar esse bug?
Postado Junho 12, 2016 9 anos function onLogout(cid)if getPlayerStorageValue(cid, 65535) > 0 setPlayerStorageValue(cid, 65535, -1)return TRUEend end function onOutfit(cid, old, current)if getPlayerStorageValue(cid, 65535) > 0 setPlayerStorageValue(cid, 65535, -1) return true end end registra as tags, acho que assim funciona Toda terça-feira um tópico novo: Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/ Peça sua spell (Suporte): https://tibiaking.com/forums/topic/84162-peça-sua-spell/ Chuva de flechas (Spell): https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/ Doom (Spell): https://tibiaking.com/forums/topic/51622-doom-spell/ Utilização do VS Code (Infra): https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/ SD com Combo (Spell): https://tibiaking.com/forums/topic/94520-sd-modificada/ Alteração attack speed (C++): https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/ Bônus de Speed (NPC): https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
Postado Junho 20, 2016 9 anos Autor Em 12/06/2016 at 18:26, Reds disse: function onLogout(cid)if getPlayerStorageValue(cid, 65535) > 0 setPlayerStorageValue(cid, 65535, -1)return TRUEend end function onOutfit(cid, old, current)if getPlayerStorageValue(cid, 65535) > 0 setPlayerStorageValue(cid, 65535, -1) return true end end registra as tags, acho que assim funciona não entendi, poderia ser mais específico? Tentei inserir dentro da talkaction rainbow e não deu, dentro da creaturescript login e tbm nao deu, tentei criar 1 creaturescript pra cada e tbm não deu... Como devo proceder? Abraço
Postado Junho 20, 2016 9 anos em creaturescript cria um arquivo chamado rainbow.lua e coloca: function onLogout(cid)if getPlayerStorageValue(cid, 65535) > 0 then setPlayerStorageValue(cid, 65535, -1)return TRUEend end em creaturescript.xml coloca: <event type="logout" name="rainbow" event="script" value="rainbow.lua"/> em creaturescript cria um arquivo chamado rainbow1.lua e coloca: function onOutfit(cid, old, current)if getPlayerStorageValue(cid, 65535) > 0 then setPlayerStorageValue(cid, 65535, -1) return true end end em creaturescript.xml coloca: <event type="outfit" name="rainbow1" event="script" value="rainbow1.lua"/> Editado Junho 20, 2016 9 anos por Reds (veja o histórico de edições) Toda terça-feira um tópico novo: Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/ Peça sua spell (Suporte): https://tibiaking.com/forums/topic/84162-peça-sua-spell/ Chuva de flechas (Spell): https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/ Doom (Spell): https://tibiaking.com/forums/topic/51622-doom-spell/ Utilização do VS Code (Infra): https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/ SD com Combo (Spell): https://tibiaking.com/forums/topic/94520-sd-modificada/ Alteração attack speed (C++): https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/ Bônus de Speed (NPC): https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
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.