I made a script that will load a player's clothing based on their teams. The script works but the Clothing doesnt load. It sometimes says in the output "failed to resolve texture format." or something like that. This is the script.
--Realy simple function to remove an item function rmItm(char, itm) --waits for the item just in case while not char:WaitForChild(itm) do wait() end --finds the item local item = char:FindFirstChild(itm) --removes the item item:remove() end --New player game.Players.PlayerAdded:connect(function (plr) print("Player Added:- " .. plr.Name) --character load plr.CharacterAdded:connect(function (char) --wait for character but clothes do not load?? while char == nil do wait()end print("Player Sporned:- " .. char.Name) wait(5) --dont know how to wait for all of the character to load? shirt not present with other waiting methods? --lopp through all of the characters incase they have multiple hatz etc. for _,v in pairs(char:GetChildren()) do --character item v class check to see what it realy is just in case the name is wrong if v:IsA("Shirt") or v:IsA("Hat") or v:IsA("Pants")then rmItm(char, v.Name) print("Removed:- " .. v.Name) end end --All done print("Player cleaned") --I dont know if this will work as i dont have the rsources to test this if plr.TeamColor == game.Teams["Atlas"].TeamColor then shirt3 = script.Clothing2:clone() shirt4 = script.Pants2:clone() shirt3.Parent = char --Clones and equips the new uniform shirt4.Parent = char end end) end)
It it most likely outputting "failed to resolve texture format." because it could not find a valid texture, try subtracting 1 from the id of the clothing then try again.