silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,480
- Solutions
- 9
- Reaction score
- 212
hello, I'm here to release this little script, can be useless to you, but I have fun
this script will make the outfits color change every 0.5 second or you can choose the interval
in talkactions/talkactions.xml paste it:
in talkactions/scripts create a new file called rainbowoutfit.lua and paste it:
in globalevents/globalevents.xml paste it: (here is the interval, 500 = 0.5 second, 1000 = 1 second...)
in globalevents/scripts/others create a new file called rainbow_outfit.lua and paste it:
this script will make the outfits color change every 0.5 second or you can choose the interval
in talkactions/talkactions.xml paste it:
Code:
<talkaction words="!rainbow" separator=" " script="rainbowoutfit.lua"/>
Code:
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
end
Code:
<globalevent name="Rainbow" interval="500" script="others/rainbow_outfit.lua"/>
Code:
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
Last edited: