How to disable the reset button?

I’m trying to prevent people from resetting in the game but I’m not experienced when it comes to disabling server core scripts.

Any methods that can accomplish this?

Best regards.

25 Likes

There are existing posts about how to do this

Proper Implementation:

local coreCall do
	local MAX_RETRIES = 8

	local StarterGui = game:GetService('StarterGui')
	local RunService = game:GetService('RunService')

	function coreCall(method, ...)
		local result = {}
		for retries = 1, MAX_RETRIES do
			result = {pcall(StarterGui[method], StarterGui, ...)}
			if result[1] then
				break
			end
			RunService.Stepped:Wait()
		end
		return unpack(result)
	end
end

assert(coreCall('SetCore', 'ResetButtonCallback', false))

Additionally, this will not prevent players from actually dying. They can still fall off the map and die, delete a part of their character and die, etc.

75 Likes

I used the same method for disabling reset that you showed here. Extremely rarely, it gives an error.

The error:


“Players.[LocalPlayer].PlayerScripts.DisableReset:20: SetCore: ResetButtonCallback has not been registered by the CoreScripts”

The error is on this line:
assert(coreCall('SetCore', 'ResetButtonCallback', false))

I have it in a localscript in StarterPlayerScripts. I’m not very good at coding so I don’t know how to fix this. It’s not very urgent because it only happens as a 1 in 30 or so chance.

2 Likes

Maybe try to add a wait function just like this:

...

wait(1)
assert(coreCall('SetCore', 'ResetButtonCallback', false))

Core callbacks take their time to get registered, so just let the script wait for a second.

7 Likes

I know it’s old post but here:

while true do
	success = pcall(function()
		assert(coreCall("SetCore", "ResetButtonCallback", false))
	end)
	wait(1)
	if success then
		break
	end
end
2 Likes

Or if you want to be funny and do it in one line.

repeat task.wait(0.5) until pcall(function() game:GetService('StarterGui'):SetCore("ResetButtonCallback", false) end);

also yes old post, but this is smart i think

15 Likes

I have a localscript in startergui if that helps

2 Likes

The best thing is:

local function SetResetButtonEnabled(boolean)
	local success, Error = 	pcall(function()
		StarterGui:SetCore("ResetButtonCallback", boolean)
	end)

	if success then

	else
		SetResetButtonEnabled(boolean)
	end
end

SetResetButtonEnabled(false)
1 Like

Let me ask you guys, when does the player reset? When he is alive.
And the best solution without any repeat cycles before character spawn or waits to me is just to place a LocalScript inside StarterCharacterScripts with simple:

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

Also sorry to bump this thread again, but I think this was a must have to add.

PS: oops this wasn’t supposed to be an answer to someone’s post, sorry

4 Likes

The reason we do this is because we want the fastest possible response.

There is no problem with this bro.

2 Likes