• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TalkAction] Rainbow Outfit (REP++)

Medevh

RPG Mapper
Joined
Jan 30, 2011
Messages
53
Reaction score
0
Location
Dubai
Hey, I've seen 2 posts of "Rainbow Outfit" but i didn't know where to put files etc.. it wasn't too clear.

YouTube - Rainbow Outfit
^ I want it exactly the same

So...please someone can post a script for "Rainbow outfit" i want only the colors keep changing and not the outfit, E.G :
Head : red etc..
Body : blue etc..
Legs : green etc..
Boots : yellow etc..

All keep changing colors together and fast, + please explain where to put like :

Data / talk action / talkaction.xml

Im using crying damson 0.3.6pl1



Thanks :)
 
Go to data/talkactions/scripts and create a file called rainbowOutfit.lua, open it and paste this
Lua:
local colors = {94, 81, 79, 88, 18, 11, 92, 128}
local storage = 65535
local time = 10 --in miliseconds
local cost = 5000
local event
 
function onSay(cid, words, param, channel)
 
        if(param == "on") then
                if getPlayerStorageValue(cid, storage) < 1 then
                        if doPlayerRemoveMoney(cid, cost) then
                                event = addEvent(changeOutfit, time, cid)
                                return setPlayerStorageValue(cid, storage, 1)
                        else
                                return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have enough money.")
                        end
                else
                        return true
                end
        elseif(param == "off") then
                if getPlayerStorageValue(cid, storage) > 0 then
                        return setPlayerStorageValue(cid, storage, 0)
                else
                        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have rainbow outfit on.")
                end
        else
                return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use !rainbow on-off.")
        end
        return true
end
 
function changeOutfit(cid)
 
local randomHead = (colors == "all" and math.random(1, 255) or colors[math.random(#colors)])
local randomLegs = (colors == "all" and math.random(1, 255) or colors[math.random(#colors)])
local randomBody = (colors == "all" and math.random(1, 255) or colors[math.random(#colors)])
local randomFeet = (colors == "all" and math.random(1, 255) or colors[math.random(#colors)])
local tmp = {}

	if cid and cid >= 0x10000000 then
		if getPlayerStorageValue(cid, storage) > 0 then
			local outfit = getCreatureOutfit(cid)
 			tmp = {lookType = outfit.lookType, lookHead = randomHead, lookLegs = randomLegs, lookBody = randomBody, lookFeet = randomFeet, lookAddons = outfit.lookAddons}
                	doCreatureChangeOutfit(cid, tmp)
                	event = addEvent(changeOutfit, time, cid)
 			return true
		else
 			return stopEvent(event)
		end
        end
end

Go to data/talkactions/ and open talkactions.xml and paste this:
XML:
 <talkaction words="!ro" event="script" value="rainbowOutfit.lua"/>

Go to data/creaturescripts/scripts and open the file logout.lua, if you don't have it then you need to create it, paste this iniside:
Lua:
local storage = 65535 --same storage used on talkaction file
 
function onLogout(cid)
	return setPlayerStorageValue(cid, storage, 0)
end

Go to data/creaturescripts/creaturescripts.xml and paste this inside:
XML:
	 <event type="logout" name="RainbowOutfit" event="script" value="logout.lua"/>

Now go to data/creaturescripts/scripts/login.lua and paste this inside:
Lua:
	registerCreatureEvent(cid, "RainbowOutfit")

If you want to use all colors, just write "all"

Example

Change
Lua:
local colors = {94, 81, 79, 88, 18, 11, 92, 128}

To:
Lua:
local colors = "all"

And you're done
 
Not working, When i say " !ro " It says : 20:37 Use !rainbow on-off."
I say !rainbowon, then nothings happen, here is a picture

 
Bump, here is the error though

[11/02/2011 17:41:48] [Error - CreatureScript Interface]
[11/02/2011 17:41:48] data/creaturescripts/scripts/login.lua
[11/02/2011 17:41:48] Description:
[11/02/2011 17:41:48] (luaRegisterCreatureEvent) Creature not found
[11/02/2011 17:41:48] [Warning - Event::loadScript] Event onLogin not found (data/creaturescripts/scripts/login.lua)
[11/02/2011 17:41:48] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/logout.lua: No such file or directory
[11/02/2011 17:41:48] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/logout.lua)
[11/02/2011 17:41:48] cannot open data/creaturescripts/scripts/logout.lua: No such file or directory
 
Last edited:
Back
Top