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

How do I check if a server is full from a different server?

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?

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

2 comments

0

I'm trying to check if another server has full players, not the same server

0

I think that is impossible.

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