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

How do you make a custom avatar for teams?

Asked by 4 years ago

So I'm making a new game where if you turn into a certain team, then you have a certain avatar. But I can't find how to script it. Anyone got any ideas?

0
Does the certain avatar have accessories? User#25069 0 — 4y
0
Yes CappaFish1 3 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I have done this many time, and it is not that difficult once you learn how, also turn off LoadCharacterAppearance in StarterPlayer so you don't have to add extra code to delete the pre-defined clothing.

First off, you need to create a player added function.

game.Players.PlayerAdded:Connect(function(plr)
    wait(1)
    local character = plr.Character --Gets the character of the player
end)

Now, you have to check for the team.

game.Players.PlayerAdded:Connect(function(plr)
    wait(1)
    local character = plr.Character --Gets the character of the player

    if plr.TeamColor == color then --Insert team color here
        --Clone items here and put them into the player
    end
end)

An example of cloning an item

game.Players.PlayerAdded:Connect(function(plr)
    wait(1)
    local character = plr.Character --Gets the character of the player

    if plr.TeamColor == color then --Insert team color here
        local shirt = game.ReplicatedStorage.Shirt
        shirt:Clone()
        shirt.Parent = character --You can also delete this line and use shirt:Clone(plr)
    end
end)

You're (hopefully) all set!

Ad

Answer this question