local Player = script.Parent.Parent.Parent.Parent.Parent local teamcolor = "Bright green" function onClick() if Player.TeamColor == BrickColor.new(teamcolor) then return else Player.TeamColor = BrickColor.new(teamcolor) Player.Character.Humanoid.Health = 0 end end script.Parent.MouseButton1Down:connect(onClick)
local Player = script.Parent.Parent.Parent.Parent.Parent -- I'm guessing this isn't a localscript, but if it is I would use game.Players.LocalPlayer local teamcolor = "Bright green" local groupID = 0 -- put the group ID here function onClick() if Player.TeamColor == BrickColor.new(teamcolor) and Player:IsInGroup(groupID) then return else Player.TeamColor = BrickColor.new(teamcolor) Player.Character.Humanoid.Health = 0 end end script.Parent.MouseButton1Down:connect(onClick)
let me write a little explanation on this wonder. Well, there's nothing to explain, but it checks if the Player is in the group ID put in the parameters.