So, I’m trying to make a system for where if a player isn’t allowed (by UserId)into the game, they are automatically kicked back out. The problem is, I don’t know how to get the value of how mayne plaers are in the server. Does anyone know?
game.Players.PlayerAdded:Connect(function(player)
local bannedUsers = {}
local playerUserId = "Player"..player.UserId
for game:Players, Player in pairs(game.Players:GetPlayers()) do
wait(0.2)
if playerUserId then playerUserId = bannedUsers[] do
player:Kick("You are banned from this game")
end
end
end
end)