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

My game.OnClose() won't work?

Asked by
Mr1Vgy 30
9 years ago

I have this script in the ServerScriptService and it throws an error, anyone know how to fix or why it throws an error?

game.OnClose:connect(function()
    wait(20)
end)

1 answer

Log in to vote
1
Answered by
woodengop 1134 Moderation Voter
9 years ago

You can learn more about this on the ROBLOX Wiki, But the layout on the ROBLOX Wiki has:

game.OnClose = function()--I think this is How you lay it out.
    print 'Closing, waiting'
    wait(3)
    print 'Done'
end
0
It work! Thanks Mr1Vgy 30 — 9y
Ad

Answer this question