Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do i make a player's avater change?

Asked by 5 years ago

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

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

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

0
Instance:WaitForChild("child") is just sugar for Instance.WaitForChild(Instance, "child") User#19524 175 — 5y
0
I didn't knew that, but beroglu112 was using Instance.WaitForChild("child") '-' (that gave a error on my tests) Leamir 3138 — 5y
Ad

Answer this question