How to private games without kicking players

Sorry if this is the wrong topic. Please let me know if it is so I can move it. This just seems like the most logical place.


Hello! Games like Tower Defense Simulator (during the August Live Event), and Lil Nas X event closed their game without kicking their players that were in it. My question is, how would I (WEcompany) accomplish this. Thank you, WE

3 Likes

Add something like a server lock during a live event.

Use this to get the number:

local ss = false
local gs = function()
	return {
		km = "An event is taking place. Sorry!",
		uTime = 694206942069420, -- your number goes here
	}
end
game.Players.PlayerAdded:Connect(function(p)
	if ss then
		p:Kick(gs().km)
		wait()
	end
end)
spawn(function()
while wait() do
	if tick() >= gs().uTime then
		ss = true
	else
		ss = false
	end 
end
end)
3 Likes

Well im talking about like privating the game completely. There is no play button at all.

2 Likes

I don’t know a way you can do this.

3 Likes

Click on the three dots on your game
Click “Configure Game”
Click on “Private”
and then save it

1 Like

image
But wait. Im confused. Doesn’t this make the servers shut down?

2 Likes

You want it so that new players cant join but old players can stay right?

2 Likes

Yes. That is what I want, but it says shut down any running games. Im just going to take your word for it for when I have the live event.

When you private a game, it’ll shut down all servers and kick all players. I recommend using SparkyFangs idea.

Games like that send a player to a different place inside the same universe. You can create a new place inside your game by going view > game > places > new place.

Use TeleportService to teleport the players to the new place.
That way, new players can’t join unless teleported by the server. They can still join the lobby, but not the game that the users you teleported are in.

Well I was planning on having a live event without teleporting the users to a live event lobby.

1 Like

Use the Epoch time, like @SparkyFangs said.

Check if the time (tick()) is greater than your desired event time and if it is, initiate the event.

To initiate the event, perhaps teleport all the players to a separate place like Tower Defense Simulator and Lil Nas X event did.

1 Like

I was planning on using os.time() but thank you anyway!

1 Like

By the way, if you didn’t know, tick() and os.time() are the same thing

Yea ik. I just use os.time().

Not exactly, tick() returns how many seconds passed since UNIX epoch depending on local computer’s time zone while os.time() by default returns how many seconds passed since UNIX epoch in UTC time zone.

1 Like