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

How do I assign a player a new TeamColor? [Answered]

Asked by 10 years ago

Simply what I tried:

        hit.Parent.TeamColor = BrickColor.new("Institutional white")

I know the problem is in the BrickColor.new("Institutional white") but I don't know what to put instead. Thanks in advance for your help!

1 answer

Log in to vote
0
Answered by 10 years ago

hit.Parent, I believe returns the Character. So it would need to be:

hit.Parent.Parent.TeamColor=BrickColor.new("Institutional white")

If it isn't that it would be

local p=game.Players:GetPlayerFromCharacter(hit.Parent)
p.TeamColor=BrickColor.new("Institutional white")

If it is something you can hit with a hat I suggest you use this.

local h=hit
if hit:IsA("Part") then
    hit.Parent.Parent.TeamColor=BrickColor.new("Institutional white")
end
0
Thank you! SchonATL 15 — 10y
0
Read the extra if you can hit it with a hat!! XtremeSpy 80 — 10y
Ad

Answer this question