Okay So i have tried to make my Own Switch team GUI script, But the rank script part did not work... heres the Script without the rank Script part!

function Click(mouse) 
if script.Parent.Parent.Parent.Parent:IsInGroup(740908) then 
script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("New Yeller") 
end 
end 
script.Parent.MouseButton1Click:connect(Click)

function onButtonClicked()
script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:connect(onButtonClicked)