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

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

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

✓ Accepted answer

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

2 comments

0

Thank you!

0

Read the extra if you can hit it with a hat!!

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