Changing the Reset Button functionality just errors

hi! trying to make the default reset button in the “esc” menu of roblox not kill the player, but instead play an animation and teleport them somewhere. i can do the animation and teleport part, i just can’t figure out how to replace the reset button functionality.

i found this post announcing that it’s possible with some code examples, but i just can’t get them to work. i know it’s meant to be in a localscript, but putting it in StarterPlayerScripts or StarterCharacterScripts gives me a SetCore: ResetButtonCallback has not been registered by the CoreScripts error.

this is my specific code, if that helps:

local resetBindable = Instance.new("BindableEvent")
resetBindable.Event:connect(function()
	print("Reset!")
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)

ResetCallBack isn’t added immediately, you’ll need to make it loop until it did

local resetBindable = Instance.new("BindableEvent")
resetBindable.Event:connect(function()
	print("Reset!")
end)

while true do
local success,_ = pcall(function()
game:GetService("StarterGui"):SetCore("ResetButtonCallback", resetBindable)
end)

if success then
break
end
task.wait()
end
3 Likes

keyword here is CallBack. It expects a function.

this is code from the official announcement, and the post before yours worked so that doesn’t seem to be the problem

2 Likes

amazing. i guess i’m working on outdated data. Thanks for the clarification.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.