I'm making a system to teleport players to their friends, but I don't know how to check if the server the friend in is full. Any way y'all know how to?
COMMUNITY QUESTION
How do I check if a server is full from a different server?
1 answer
First insert a script in ServerScriptService.
Inside the script type these two scripts
function insertValue(player)
local String = Instance.new("StringValue") -- inserts a new string value inside the player.
String.Parent = player
String .Name = "inGame"
This loop will check the number of players in the game.
local availablePlayers = {} -- making a table of players
for i, player in pairs(game.Players:GetPlayers()) do -- putting the players inside the table.
if player:FindFirstChild("inGame") then.
table.insert(availablePlayers, player)
end
end
if #availablePlayers = 8 then -- change this to the maximum number of players in a server of your game.
print("Server full!")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I'm trying to check if another server has full players, not the same server
I think that is impossible.