local Voc = getPlayerVocation(player)
for k in pairs(outfits) do
if k == Voc then
player:addOutfit(outfits[k].male)
player:addOutfit(outfits[k].female)
if player:getSex() == 0 then
player:setOutfit(outfits[k].female
else
player:setOutfit(outfits[k].male)
end
else
player:removeOutfit(outfits[k].male)
player:removeOutfit(outfits[k].female)
end
end
Code:local Voc = getPlayerVocation(player) for k in pairs(outfits) do if k == Voc then player:addOutfit(outfits[k].male) player:addOutfit(outfits[k].female) if player:getSex() == 0 then player:setOutfit(outfits[k].female else player:setOutfit(outfits[k].male) end else player:removeOutfit(outfits[k].male) player:removeOutfit(outfits[k].female) end end
Ofc, my bad =P I will do it next time.Also, next time post the script instead of a picture, it's easier and would save some time.
errors?Ofc, my bad =P I will do it next time.
Just one more thing here: I'm using TFS 1.1, did you know if exists some function to set the player outfit to the outfit i've added him? This player:setOutfit() doesnt work and i dont know why =/
player:setOutfit({lookType = outfits[k].male})
Okey, that works...Code:player:setOutfit({lookType = outfits[k].male})
local Colors = {
head = 0,
body = 0,
legs = 0,
feet = 0
}
Forget, i got it! This is the Script:Uh, you want the players to have colors you specify?
-- Vocation Outfits:
local outfits = {
[110] = {male = 131, female = 139}, -- Human Warrior: Knight Outfit.
[120] = {male = 130, female = 138}, -- Human Magician: Mage Outfit.
[130] = {male = 129, female = 137}, -- Human Ranger: Hunter Outfit.
[210] = {male = 7, female = 7}, -- Orc Warrior: Orc Warrior Outfit.
[220] = {male = 5, female = 5}, -- Orc Magician: Orc Outfit.
[230] = {male = 50, female = 50}, -- Orc Hunter: Orc Spearman Outfit.
[310] = {male = 62, female = 62}, -- Elf Warrior: Elf Outfit.
[320] = {male = 62, female = 62}, -- Elf Magician: Elf Outfit.
[330] = {male = 62, female = 62}, -- Elf Ranger: Elf Outfit.
[410] = {male = 71, female = 71}, -- Dwarf Warrior: Dwarf Soldier Outfit.
[420] = {male = 69, female = 69}, -- Dwarf Magician: Dwarf Outfit.
[430] = {male = 69, female = 69} -- Dwarf Magician: Dwarf Outfit.
}
local Voc = getPlayerVocation(player)
local Sex = player:getSex()
local Outfit = player:getOutfit()
local Colors = {
head = Outfit.lookHead,
body = Outfit.lookBody,
legs = Outfit.lookLegs,
feet = Outfit.lookFeet
}
for i in pairs(outfits) do
if i == Voc then
player:addOutfit(outfits[i].male)
player:addOutfit(outfits[i].female)
if Sex == 1 then -- If player are Male:
player:setOutfit({lookType = outfits[i].male, lookHead = Colors.head, lookBody = Colors.body, lookLegs = Colors.legs, lookFeet = Colors.feet})
elseif Sex == 0 then -- If player are Female:
player:setOutfit({lookType = outfits[i].female, lookHead = Colors.head, lookBody = Colors.body, lookLegs = Colors.legs, lookFeet = Colors.feet})
end
elseif i ~= Voc then
player:removeOutfit(outfits[i].male)
player:removeOutfit(outfits[i].female)
end
end
--