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

How do you create a Team On Click?

By A team on click I mean if you are in a certain group and click a TextButton it creates a team and assigns you that team. But, It needs to create the team when you click it because I don't want the server full of teams.

1 answer

✓ Accepted answer

You can use the MouseButton1Down event, create the team, and set the player's Team property to it.

As for the group checking.. look use the IsInGroup function.

local plr = game.Players.LocalPlayer
local group = 000000

script.Parent.MouseButton1Down:Connect(function()
	if plr:IsInGroup(group) then
		local newTeam = Instance.new("Team",game.Teams);
		plr.Team = newTeam;
	end
end)

note: if the player's team is changed the newTeam will still exist.

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