In my Roblox game I made a team change GUI and it works, in the Roblox Studio. When I publish it and play the game the GUI shows up but it wont change my team when I click it.
This is the exact script:
function Click(mouse) script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Black") script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end script.Parent.MouseButton1Click:connect(Click)
local plr = script.Parent.Parent.Parent.Parent.Parent.Name script.Parent.MouseButton1Click:connect(function() game.Players[plr].TeamColor = BrickColor.new("Crimson") end)
Chanage the Colour and you dont have to have to make it kill players just make the gui Not visible by adding on
script.Parent.Visible = false
You need to have the team in the "Teams" folder, and the rest is as easy as this:
Player.TeamColor = game.Teams.ExampleTeam.TeamColor
function Click(mouse) script.Parent.Parent.Parent.Parent.Parent.TeamColor = game.Teams.TEAMNAME.TeamColor script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 -- You don't need to do this, but use it if it is necessary end script.Parent.MouseButton1Click:connect(Click)