Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a player's avater change?

I have a script in my ServerScriptService and its supposed to change the player's avatar but it doesn't work. My Script

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(Character) if player.Team == game.Teams.Child then Character.WaitForChild("Shirt").ShirtTemplate = "rbxassetid://1598177943" Character.WaitForChild("Pants").PantsTemplate = "rbxassetid://1598177943" else end end) end)

1 answer

Hello, beroglu112!

Try this:

game.Players.PlayerAdded:Connect(function(player)            
    player.CharacterAdded:Connect(function(Character) 
        if player.TeamColor == game.Teams.Child.TeamColor then --Try using the teams color
            Character:WaitForChild("Shirt").ShirtTemplate = "rbxassetid://1598177943" -- Its not .WaitForChild, it is :WaitForChild
            Character:WaitForChild("Pants").PantsTemplate = "rbxassetid://1598177943" -- Its not .WaitForChild, it is :WaitForChild
        else
        end 
    end) 
end)

This is a simple, but commom error

Good Luck with your games

2 comments

0

Instance:WaitForChild("child") is just sugar for Instance.WaitForChild(Instance, "child")

0

I didn't knew that, but beroglu112 was using Instance.WaitForChild("child") '-' (that gave a error on my tests)

This discussion is preserved as it was. New answers, comments, and votes are closed.