Problem with team assigning

  1. What do you want to achieve? Keep it simple and clear!
    So i need to assign by button player in team.
  2. What is the issue? Include screenshots / videos if possible!
    I used client one and it create a lot of glitches, but now i don’t have idea how to write it
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    used local script.
local BlueTeam = game.Teams.BLUE
local Players = game.Players
local Button = script.Parent
local Gui = script.Parent.Parent.Parent
Button.MouseButton1Click:Connect(function(Player)
	Player.Team = BlueTeam
	Gui.Enabled = false

end)
	

image

Normal scripts don’t run in GUIs so change the script to a local script. Also you are going to need to use remote events to make the player change teams on the server not just on the client

This should be changed to a local script and have a remote event ask the server to perform the team change on its behalf

Button.MouseButton1Click doesn’t return the Player that clicked it?

Got it, thanks you a lot. Thanks