How would you be able to make a thing where you can only play a game in a private server?

Hey hey! I just need a little bit of help

Just like in Traitor Town Customs, If you try joining the server on a public server. You would be kicked out because you aren’t in your private server.

Replies are appreciated, Cheers!

1 Like

This will help:

you just do the check:

game.Players.PlayerAdded:Connect(function(plr)
	if game.PrivateServerId ~= "" then
		print('Plr in private server')
	else
		plr:Kick("Not in private server")
	end
end)
1 Like
game:GetService("Players").PlayerAdded:Connect(function(plr)
	if game.PrivateServerId ~= "" then
		print('Plr in private server')
	else
		plr:Kick("Not in private server")
	end
end)
2 Likes

but it’s still working ¯_(ツ)_/¯

1 Like

Well yes, it by no means errors ever.

2 Likes

true. Thank you for correction

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.