Hi,
Basicily when a player clicks his button it is supposed to check if the user is that certain rank in that group if they are then they are teamed. if not then the click is ignored.
I don't know why it does not work.
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent.Parent:GetRoleInGroup(798194) == 254 then script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Sand blue") script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 else end end script.Parent.MouseButton1Down:connect(Click)
This may not be your problem, but just a suggestion:
Use a LocalScript for this instead of using all those parents. You also don't need the else statement, it will automatically ignore the request if the if statement is not met.
script.Parent.MouseButton1Down:connect(function() player = game.Players.LocalPlayer -- Gets the player if player:GetRoleInGroup(798194) == 254 then player.TeamColor = BrickColor.new("Sand blue") player.Neutral = false -- Player can't be neutral, don't know if that'll help, but good practice. player.Character.Humanoid.Health = 0 end end)