local outfit = self: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)
self:setOutfit(outfit)
tfs req?You can do the outfit change here forgottenserver/monster.lua at master · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/data/events/scripts/monster.lua#L11)
Just add something like
LUA:local outfit = self: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) self:setOutfit(outfit)
I forgotte, i want it only for one monsterYou can do the outfit change here forgottenserver/monster.lua at master · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/data/events/scripts/monster.lua#L11)
Just add something like
LUA:local outfit = self: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) self:setOutfit(outfit)
Tfs 1.5 8.6tfs req?
"self:" in syntax hm
class="Monster" method="onSpawn" enabled="0"
to enabled="1"
function Monster:onSpawn(position, startup, artificial)
-- Random head colour
if (artificial or startup == true or false) and (self:getName() == "random hair coloured guy") then
local headColors = {0, 19, 38}
self:setOutfit({lookType = 276, lookHead = headColors[math.random(#headColors)]})
end
return true
--[[
-- Random Outfit
local outfitId = {29, 35, 37, 39, 41, 43, 45, 47}
if (artificial or startup == true or false) and (self:getName() == "random outfit guy") then
self:setOutfit({lookType=outfitId[math.random(#outfitId)]})
end
return true
]]--
end