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?
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)
local StarterGui = game:GetService("StarterGui")
task.spawn(function()
while not pcall(StarterGui.SetCore, StarterGui, "ResetButtonCallback", false) do
task.wait()
end
end)
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.