script is for changing a team the TeamNum.value is obviously the team selection since the team is created in another script. Works in studio but won't work in game, shows no errors
function Click(mouse) if script.Parent.Parent.Parent.Parent:IsInGroup(1148295) then game.Players.LocalPlayer.TeamNum.Value = 1 script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 game.StarterGui.TeamChange:remove() end end script.Parent.MouseButton1Down:connect(Click)
You're changing stuff in startergui. This is the service that replicates everything inside of it into a players PlayerGui when their character adds. You should change everything in game.Players.LocalPlayer.PlayerGui.*
instead of game.StarterGui.*
You can read more about it here