Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Team change gui not changing my team in game?

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) 

1 comment

0

Is this a LocalScript or script?

2 answers

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

1 comment

0

Wrong.

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) 

This discussion is preserved as it was. New answers, comments, and votes are closed.