So basically Im trying to make a team GUI where if you’re in a certain group and click lets say the “National Guard” button it will create a new team. I don’t want to have to manually input teams because it looks sloppy since they appear even when players are not in the team.
So how would I make this function in fe and make the team disappear if no one is in it It is located here:
Here is my code so far:
> local but = script.Parent:WaitForChild("TextButton")
but.MouseButton1Down:Connect(function()
local test = Instance.new("Team")
test.TeamColor = ("Really red")
test.Parent = game.Teams
end)
Go with what incapaxx stated. You should never use a Script to use any sort of interface events. However, this would work if you were to implement what incapaxx had said as well as taking advantage of RemoteEvents for these changes to replicate throughout the server.
Also, please note. When you use a RemoteEvent, you always want to add “Player” as the first parameter. I see this mistake a lot and the first parameter on a RemoteEvent is always the player whose fired the remote. I’ve listed an example on how to use RemoteEvents below.
No problem. If you have anymore questions, please feel free to ask. And @incapaxx thanks for clarifying, I was confused on why he said it was the wrong section.