game:BindToClose in PluginScript will Crash upon exit

  • open a baseplate

  • create a script

  • copy and paste this into that
    game:BindToClose(function()

    end)

  • Save as LocalPlugin…

  • close Studio and Save

  • observe crash

Baseplate.rbxl (18.3 KB)

crash.lua (35 Bytes)


I’m not sure if we are suppose to use this in plugins but I’m trying to detect when Studio is closed

1 Like

Make sure you follow these steps to send a crash dump to https://devforum.roblox.com/g/bug-files:

2 Likes

IIRC you should use plugin.Unloading for this purpose.

1 Like

Just tried doing plugin.Unloading, but it doesnt fire when the place is getting closed.
Did this get changed or am I doing something wrong?

There is no way for me to tell you that without knowing more context. Create a #help-and-feedback:scripting-support thread, do not bump old bug reports. Judging by this announcement, it should fire. Studio Plugin Unloading Changes

1 Like

This issue no longer reproduces, please create a new thread for a new issue.