How can I create a test server?

Hello,
How do I make a game where only I and selected people can join in? I also want to get the game visible in my group so I can join it easier cause I know how you can give permissions but than I can’t se my game anymore.

What do I want to create?
I want to create a script that only the usernames that I selected can join but idk how to make that?

4 Likes

You can create a table in a script with the name of the allowed players then

in a PlayerAdded event, you check if the player’s name is in that table, if not then you kick the player

3 Likes

Thx that’s a good way I’m now only gonna search how to kick people.

Okay no problem, you can just do

local allowedplayers = {“dev”,“pro”}

if not table.find(allowedplayers,player.Name) then
player:Kick(“You are not allowed to enter”)
end

but wrap that in a playeradded event to get the player variable

2 Likes

I did make a script for it but now it is kicking all players can you help this is the code

local WhiteList = {"TurteleDJ", "GreenTxrtIe", "NotKxng"}

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(chr)
		for i = 1, #WhiteList do
			if WhiteList[i] == plr.Name then
				print("Owner did join the game")
			elseif WhiteList[i] == plr.Name == false then
				plr:Kick("You are not allowed to join the game only game devs can join the game this game is in test proces")
			end
		end
	end)
end)

The problem has been fixed ty for all the help
This did fix it