What i mean is if you touch a brick if your team is "Red" it will change to Red or if it was blue it would change to blue.
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then --make sure what has been touched is an actual character by checking if it has a humanoid local plr = game.Players:GetPlayerFromCharacter(hit.Parent) -- here we get the player object of the character assert(plr ~= nil,"what has been touched is not a player's character") -- this breaks the function and errors ("what has been touched is not a player's character") if the condition is false which means that it errors if the character that has been touched is **not** a player's character local teamColor = plr.Team.TeamColor --here we directly get the player's Team and then its BrickColor (which is named TeamColor, just for teams only though) script.Parent.BrickColor = teamColor -- and then change the script's parent BrickColor to it. end end)
99% sure this is a troll dude anyway
if team == "Red" then script.Parent.Color = "Red" end
try this, its off the top of my head so if it doesn't work don't witch hunt me lol (this would also be in a normal script btw)
local teams = game:GetService("Teams") script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and teams == "Red" then --insert the name of your team script.Parent.Color = "Red" --insert the color of the team end)
i know this most likely didn't work but that's the gist of what your final product will be. Research it more and try to tweak it. Make sure to mark as answered if I helped :D