Warden = game.Teams.Warden
NumberAllowed = workspace.NumberAllowed
function checkSurvivorNumber(mouse)
local count = 0
local mouse_player = game.Players:GetMousefromCharacter(mouse.Parent)
local players = game.Players:getChildren()
for i = 1, #players do
if players[i] ~= nil then
if players[i].TeamColor == game.Teams.Warden.TeamColor then
count = count + 1
end
end
end
if count >= NumberAllowed then
return
end
mouse.Parent.TeamColor = game.Teams.Lobby.TeamColor
script.Parent.MouseButton1Click:connect(checkSurvivorNumber)
Hello, I've been working on this script for an hour, but I have no answer. I was wondering if anyone can help me thoroughly. What I am trying to do is to make a GUI where if there is already one person on the team, then whoever clicks the GUI for that team can not get onto the team NumberAllowed is a IntValue of 1 because there can only be one person on that team.

2 comments
You cant make a gui thats makes one person on a team :/ You can make a script but you havent explained at what the gui does to sto, etc
Wait i think i see whats wrong