If your game uses non-standard characters or there are areas you don’t want players to be able to reset you can now customize the reset button in the CoreGui menu to better suit your game.
The API is a SetCore method and is used like this:
Setting ResetButtonCallback to a BindableEvent will mean that the BindableEvent is fired when the player tries to reset in the in-game menu. If you set ResetButtonCallback to false then the reset button in the menu will be grayed out, reducing the confusion for players when they can’t reset.
Here is a longer example of how you might use this in your game:
local resetBindable = Instance.new("BindableEvent")
-- Implement custom reset logic here
-- This will remove the current behavior for when the reset button
-- is pressed and just fire resetBindable instead.
-- Setting ResetButtonCallback to false will grey out the reset button
-- in the menu and players won't be able to reset in your game.
Love theese new updates so much!
Will setting it to
true restore the default thing?
If it’s a callback, shouldn’t it be using a bindablefunction?
I can’t believe you made this so fast and got it published!
Can’t wait to use it, tysvm!
Currently you have to restore the default functionality yourself. I can probably add this for convenience though.
Technically yes, but I made it a BindableEvent to ensure that the code run can never interfere with the CoreScripts. It’s still called ResetButtonCallback because that is a more intuitive name for something that overrides the existing behavior.
Wouldn’t ResetButtonEvent be more intuitive, since it’s an event and not a callback?
To me that ResetButtonEvent suggests that the API will add a new event to fire when the player resets but not override the previous behavior. Callback suggests that there can only be one. I don’t think there is a huge difference either way though.
A possible alternative could be to use a BindableFunction, but execute it in a new thread using spawn.
Why not just use a function?
Are we expected to yield before using this? Or is play solo just bugged?
I love you @TheGamer101. You are the younger zeuxcg.
Oh my god I didn’t think that this would be made so quickly!
Bless you @TheGamer101, you are a saint!
######~now we just need neon intensity properties~#####
Who said that?
Thank you for following up! =)
I am getting the following error on Android when I call SetCore(“ResetButtonCallback”, bindableEvent):
SetCore: ResetButtonCallback has not been registered by the CoreScripts
Do I need to yield before I call this method? Seems hacky.
We can fix this by registering the SetCore method earlier. I made a pull request to the CoreScripts GitHub.
Great addition - thank you.