ResetButtonCallback not working for 3 years

Is there any update coming to this, it’s been an issue for a very long time and happens so frequently.
It seems to happen to a large percentage of users in my games, and based on that disabling the reset button is something that is super unreliable, which is a very basic option developers should have for their games.

7 Likes

The script provided in the solution of your linked post has a 100% success rate as far as I’m aware. Although yes, it is longer than it should be and this issue needs to be fixed.

1 Like

I copy and pasted it exactly and the issue was still occurring for about 10-25% of my players.

I know that I used to get the warning if I tried to use :SetCore immediately, but adding a wait for around a second got rid of it. Does your code do that?

This is not a bug, but a weird behaviour. As @DrDarkBlock has shown, this is intended behaviour due to core callbacks not registering immediately. What I suggest is to loop pcall() until it is successful.

local Success
repeat -- Starts the loop
     Success = pcall(function() -- To ensure an error won't break the loop
          StarterGui:SetCore("ResetButtonCallback",BindableEvent) -- Bind
     end)
     if not Success then -- To ensure there is not an infinite error
          task.wait() -- wait() is deprecated. Using non-deprecated version
     end
until Success -- Ends if the pcall returns true
1 Like

Nope, it is absolutely a bug. The functionality of SetCore/ResetButtonCallBack are not matching their intended purpose as described by the API. Also my original post and the one DrDarkBlock referenced mention that using pcalls does not resolve the issue.

How exactly is not working 25% of the time intended behavior? Does this mean that bugs that only occur sometimes don’t exist because when they occur it means they were actually intended to not work those times?

This is not a bug because the CoreScripts take time to register each of their SetCore functions and register these at the same time as your localscript being run. This would be like reporting the loading screen taking extra long to load your game as a bug, the CoreScripts take longer to register these functions depending on several factors. If anything this is a documentation issue and not an engine issue.

This code is flawed, 8 retries is not enough in many cases.

1 Like

Agree’d. As someone who has never gotten this issue ever since I do the method I do now, I have never had a single script stall indefinitely.

That’s not correct either. The code is not the issue as I have tried both with and without a limit (and 100 other ways) and it fails regardless of what I do or when I do it. Some users will experience it fixing itself after resetting once and for others not at all.

Why would that be a documentation issue? The intended function is for developers to be able to control or disable the reset button, and we are not able to do that at any point in the game. How would you suggest fixing the documentation then?

I myself have never gotten the issue either and it still exists.

I have personally never experienced this issue in all my time developing and testing experiences with groups of up to hundreds of players, are you sure this isn’t a visual issue as the reset button does not visually show as disabled on any platform except desktop, could it be possible players are noticing this visual issue and reporting it to you as a functional issue?

The documentation has the fact that pcalls are needed as a side note rather than a main point of the function.

Can you show me the code that has been working for you and I can try implementing it in my game?

This basic code is what most of my projects use and I’ve never encountered an issue with any player ever (it’s likely similar to what you have in your experiences):

local s : boolean = false
local StarterGui : StarterGui = game:GetService("StarterGui")
local RunService : RunService = game:GetService("RunService")
repeat
	RunService.Heartbeat:Wait() -- we may never register if Roblox entirely disables the ability to remove the reset button, we don't want to lag out if this happens
	s = pcall(StarterGui.SetCore, StarterGui, "ResetButtonCallback", false)
until s
-- beware: if Roblox disables the ability to disable the reset button, this code will never run

Thank you, this seems to be working! It was an issue with my code after all.

1 Like

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