Script idea if player is on team then change brickcolor and material
Everything works but it always turns White even if I am on the Dark team. Any fixes?
local white = ("Institutional white")
local black = ("Really black")
local teams = game.Teams:GetTeams()
script.Parent.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
hey = player.TeamColor
for idx = 1, #teams do
local team = teams[idx]
if team.Name == "Light" then
script.Parent.BrickColor = BrickColor.new(white)
script.Parent.Material = "Neon"
break
end
if team.Name == "Dark" then
script.Parent.BrickColor = BrickColor.new(black)
script.Parent.Material = "Neon"
break
end
end
end
end)
