Well i can tell you that you should changed the humanoid health and the team in a normal script. To change the gui use a local script. Then use a remote event to connect the two.
Local Script:
local plr = game.Players.LocalPlayer
local RemoteEvent = -- Put the path to the remote event here
script.Parent.MouseButton1Click:Connect(function()
script:FindFirstAncestorWhichIsA('GuiObject').Enabled=false
RemoteEvent:FireServer()
end)
Server Script:
local RemoteEvent = -- Put the path to the remote event here
RemoteEvent.OnServerEvent:Connect(function(plr)
plr.TeamColor.new('New Yeller') -- I don't know if this works I just pulled it from your code
plr.Character.Humanoid.Health = 0
end)