• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Random Colors of Outfit in a Starter Player !!

Nubaza

LUA Scripter
Joined
Jun 5, 2011
Messages
330
Solutions
1
Reaction score
21
Location
New Zeland
Hello! I've made a script to change all the starter players outfit's random colors.

First go to you data/creaturescripts/scripts/...
Create a outfit.lua and remplace with this:
Lua:
function onLogin(cid)

local Vitin = getPlayerStorageValue(cid, 51123)

if Vitin == -1 then

	local out = getCreatureOutfit(cid)

		doCreatureChangeOutfit (cid, {lookType = out.lookType, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132), lookAddons = out.lookAddons } )

setPlayerStorageValue(cid, 51123, 1)

end
return true
end

Add this tag to creaturescripts.xml:
Code:
	<event type="login" name="Outfita" event="script" value="outfit.lua"/>

Done, you players when login in the game, his outfit colors will be random changed. Only works one time, later, don't change the colors, works with a simple storage :p

Credits:
otland.net (Nubaza)
 
Cool script, but it won't work for 0.3.6 + because of old functions so here is updated version
Lua:
local storage = 3000

function onLogin(cid)
	if isPlayer(cid) and getCreatureStorage(cid, storage) < 0 then
		local outfit = getCreatureOutfit(cid)
		doCreatureChangeOutfit(cid, {lookType = outfit.lookType, lookHead = math.random(132), lookBody = math.random(132), lookLegs = math.random(132), lookFeet = math.random(132), lookAddons = outfit.lookAddons})
		doCreatureSetStorage(cid, storage, 1)
	end
	return true
end
 
Back
Top