Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make someone to be a team that I want?

Asked by 4 years ago
Edited 4 years ago

If someone click the GUI button, I want to create citizen team and make that player to be in citizen team. I successed for making a Citizen team but I failed that player to be in the citizen team. How can I fix it?

script.Parent.MouseButton1Click:Connect(function(player) local Team = game:GetService("Teams") local Citizen = Instance.new("Team", Team) Citizen.TeamColor = BrickColor.new("New Yeller") Citizen.AutoAssignable = false Citizen.Name = "Citizen" player.TeamColor = "New Yeller" game.StarterGui.ScreenGui:Remove() end)

1 answer

Log in to vote
0
Answered by 4 years ago

Hello

Firstly, you need to better indent your code, its very hard to diagnose any problem with it being like that.

However, if there is no syntax error in your code, the issue might be with the Neutral team player setting. If a player has there team setting set as neutral, they will not change team, even with a change of TeamColor. You can see the documentation for this here

You can disable this setting in the player by simply running:

player.Neutral = false

Hope this helps, Tweakified

Ad

Answer this question