I am trying to make a script where it will change the players team when they click a button if they are in a certain group as seen in my code below:
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Parent.Parent:IsInGroup(11750790) then
script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Cocoa")
script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
However, the script I created is not working. What did I do wrong and how do I fix it?
If it helps, this is my explorer tab:

Any help would be greatly appreciated!