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

How can I change players outfits depending on a team?

Asked by 8 years ago

Such as in Alexnewtrons

I realized that this would not work: game.Workspace.Players.LocalPlayer.Shirt = id if game.Workspace.Players.LocalPlayer.Team = Red (Yes I am very bad at scripting.)

2 answers

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

A good way to do this is to store a character template, then when you spawn a character on a certain team, replace all of their appearance assets with a copy of the template's contents.

Ad
Log in to vote
0
Answered by 8 years ago

Easy I would use values (but only because I am addicted to them) so a value with a script that would change when the player's team changes so

if Player.Team.Value == 1 then
--however you want to get to the player's shirt
playerhierarchyhere.Shirt.ID = 314159265
elseif Player.Team.Value == 2 then
--however you want to get to the player's shirt
playerhierarchyhere.Shirt.ID = 123456789
elseif Player.Team.Value == 3 then
--however you want to get to the player's shirt
playerhierarchyhere.Shirt.ID = 8787878787
end

(this was posted before I realized waffle had sry)

Answer this question