Reset Button Not Disabling

I have a script located in StarterGui that disables the ability to reset a player. But a couple of days ago it stopped working: I didn’t change anything in it: but I noticed that the button now has the text “Respawn” instead of “Reset”. Is there any way to fix this?

image
error message

wait()game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)

disabling script

1 Like

Maybe try with a task.wait()?

task.wait(); game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)

nothing changed - still getting this error

1 Like

I am unable to replicate this issue, have you tested your script in a blank baseplate?

Simply having the script alone isn’t enough. It’ll work most of the time but occasionally error.

For @mikha479, here’s a way to disable it without errors.

task.spawn(function()
	repeat
		local Success, ErrorMessage = pcall(function()
			game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
		end)
		if Success and not ErrorMessage then break end
		task.wait()
	until false
end)
1 Like

All correct, but I’d write it more concisely as

local StarterGui = game:GetService("StarterGui")

task.spawn(function()
	while not pcall(StarterGui.SetCore, StarterGui, "ResetButtonCallback", false) do
		task.wait()
	end
end)

to make use of the loop’s conditional.

This topic is a duplicate of Changing the Reset Button functionality just errors (and likely others). Future viewers, see the second paragraph of StarterGui | Documentation - Roblox Creator Hub.

I’d love for Roblox to change this function to store whatever state we pass when the function is called before the CoreScripts are registered, but it’s been this way for a while. At least we have task.wait() to idle better than wait() before it.

1 Like