Introducing SmartShutdown!

@alexfinger21 Does this bring them to a vip or rejoin them automatically

I disagree. You cannot have a set-in-stone wait time. When provided with no arguments, the wait function will pause the running thread until the next scheduler cycle, since there’s a certain part of the cycle in which sleeping threads are checked on and awoken when necessary.

3 Likes

I think you might be better off doing animations on the client perhaps? Try instead firing a remote event to the client, which can instead do a tween instead of a loop.

Edit: Here’s a simple implementation I wrote up just now that provides a basic interface without any animations using a teleport gui.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

local teleportGui = ReplicatedStorage:WaitForChild("TeleportGui")

function OnShutdown()
    local players = Players:GetPlayers()

    -- be sure to teleport any players that have just joined
    Players.PlayerAdded:Connect(function(player)
        TeleportService:TeleportToPlaceInstance(PLACE_ID, jobId, player, nil, teleportGui)
    end)

    -- teleport all players
    local jobId = TeleportService:TeleportPartyAsync(PLACE_ID, players, nil, teleportGui)

    -- wait until all players have left
    repeat wait(1) until not #Players:GetPlayers()
end

game:BindToClose(OnShutdown)
2 Likes

rejoin automatically, so don’t worry!

meh, I don’t think it will matter. But yes, use tweeting for advanced effects!

I think it does matter. Each time you update the transparency, it has to be replicated over to the client which can be very costly and unnecessary.

2 Likes

You’re blatantly rejecting valuable knowledge when you’re CLEARLY doing bad practices, Ignorance is not bliss.

2 Likes

What knowledge am I rejecting? I have a lot of experience with tweeting. I use it for most effects. However, it’s my personal preference to use loops for fade-in effects.

Do you have numbers to back this up? For example, if the client has the usual ping of 100 ms, then it’s 1/10 of a second. That’s barely measurable. Sure, if you prefer so, you can do it, but I was just making a simple module for people to use, if you want to modify it, then modify it.

Once again, it can be unnecessary, but remote events are literally the same thing, and when a client updates their GUI, it updates on the server too.

I would still just prefer to tween GUIs on the client. I don’t think there are any advantages at all for not doing so. The server has to deal with constantly updating each of the clients’ interfaces’ transparencies step by step, when they can instead just send them 1 event to just handle the transition locally.

One-tenth of a second is already quite a bit. It’s equivalent to 10 frames per second.

After all, you are right, and I was considering this. I’ll add it to the module, as if the server is running a lot of threads, this might become a problem.

I have added this feature! Scroll up in updates to see!

Personally, this is very well done! But one thing, I think there should be a bigger GUI for the SmartShutdown as it can freeze the screen. (for me it does that). For shutdowns, kicks, or bans it can freeze screens. So with a whole GUI, you won’t notice it and it can run more smoothly. (my opinion)

1 Like

Great idea, also, should I add a template GUI in the module?

I think that is a very good idea.

Okay! I am currently researching how to do so, seems like a great idea.
EDIT: Apparently, you can’t freeze the screen, the games achieve that effect by adding a blur, shall I do that?

So, what I meant by ‘freeze screens’ is that I do not know if this depends on computers, but when there is a shutdown, it freezes a bit so you can rejoin the server.

I think that with a whole GUI it would be better as you won’t notice and freezes going on.

A blur would be good too, though.

Oh-I will see if I can do that, currently, I will add the GUI.

Major update roll-out! Read the new documentation.

Alright. I’ll check it out right now.