How to make a gui appear when the game closes

so i made a script that waits 30 on game shutdown and i want a gui to appear, but it doesnt. everything else works fine. here are the scripts:

game:BindToClose(function()
	game.ReplicatedStorage.Remotes.CloseGui:FireAllClients()
	wait(30)
end)
game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("CloseGui").OnClientEvent:Connect(function()
	game.Players.LocalPlayer.PlayerGui.SoftShutdown.Main.Visible = true
end)

Is the “SoftShutdown” screen gui already enabled?

image

is that “BindToClose” script the second script shown? If it is, change it to a local script.

BindToClose is the first script i sent

So your “BindToClose” function works fine?. But your Remote event doesnt fire??

(I’m unable to access studio rn. So sorry if i get something here wrong :sweat_smile: :sweat_smile:)

I wrote this small pice of code quick. Hope this helps you :smiley:

  1. Insert a new script into “ServerScriptService”. And type this:

game:BindToClose(function()
[Your event]:FireAllClients()
wait(30)
end)


  1. Make a new LocalScript inside your Gui. And type this:

[Your Event].OnClientEvent:Connect(function()
script.Parent.Main.Visible = true
end)

Hope this helps you :slightly_smiling_face: :smiley:

1 Like