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
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)
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.
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.