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:
game:GetService(“StarterGui”):SetCore(“ResetButtonCallback”, BindableEvent)
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")
resetBindable.Event:connect(function()
-- Implement custom reset logic here
end)
-- This will remove the current behavior for when the reset button
-- is pressed and just fire resetBindable instead.
game:GetService("StarterGui"):SetCore("ResetButtonCallback", resetBindable)
-- Setting ResetButtonCallback to false will grey out the reset button
-- in the menu and players won't be able to reset in your game.
game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
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.
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.