Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

game.OnClose() not working?

Asked by
Xuxiym 15
8 years ago

Whenever I try to run game.OnClose() and shutdown all the server instances, the GUI does not appear nor does a 30 second wait happen like it supposed to?

local Players = game:GetService("Players")

game.OnClose = function()
    for _,player in pairs(Players:GetPlayers()) do
        local gui = game.Players[player.Name].StarterGui.MainUI
        local shutdownFrame = gui.ShutdownNotice
        shutdownFrame.Visible = true
    end
end
0
I just noticed I messed up, give me a second. Xuxiym 15 — 8y
0
Still not working, updating so that I can fix the issue that I did in the script. Xuxiym 15 — 8y

Answer this question