Nossa, tu criou um onThink pra checar entre todos os players online quem tem a storage ? wtf '-', era so criar um event dentro da talkaction, anyway ficou legal até.
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- TFS 1.X Rainbow Outfit
2
1.4k
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Nossa, tu criou um onThink pra checar entre todos os players online quem tem a storage ? wtf '-', era so criar um event dentro da talkaction, anyway ficou legal até.
info
Grupo: Visconde
Registrado: 20/06/15
Posts: 331
Reputação: +205
Gênero: Masculino
Em talkactions/talkactions.xml:
Em talkactions/scripts crie um arquivo chamado rainbowoutfit.lua dentro dele coloque:
function onSay(player, words, param) if param == 'on' or param == 'ON' then player:setStorageValue(8178237, 1) player:sendCancelMessage("rainbow outfit is actived.") elseif param == 'off' or param == 'OFF' then player:setStorageValue(8178237, 0) player:sendCancelMessage("rainbow outfit is disabled.") else player:sendCancelMessage("wrong parameter, use on or off.") end return false endEm globalevents/globalevents.xml:
Em globalevents/scripts/others crie um arquivo chamado rainbow_outfit.lua:
function onThink(interval) for _, player in ipairs(Game.getPlayers()) do if player:getStorageValue(8178237) == 1 then -- here is the storage to check if is "on" or "off" local outfit = player:getOutfit() outfit.lookHead = math.random(0, 132) outfit.lookBody = math.random(0, 132) outfit.lookLegs = math.random(0, 132) outfit.lookFeet = math.random(0, 132) player:setOutfit(outfit) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) end end return true end