I was trying my hardest to make an on touched team brickcolour event but just can’t quite get it. I need a part to change to the colour of the player’s team colour for instance, if the player is on yellow team the brickcolour of the object will change to yellow?
✓ ANSWER ACCEPTED
How do you make a team on touched event for a part to change its brickcolour?
1 answer
✓ Accepted answer
Check the players team when the player touches a part:
part = game.Workspace.Part
part.Touched:Connect(function(hit)
--see if the thing being touched is the players character by looking for the characters name in game.Players
local player = game.Players:FindFirstChild(hit.Parent.Name)
if(player)then
--if you look on the wiki, team color is a brick color
-- which means we can assign it to the parts color
part.BrickColor = player.Team.TeamColor
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
