Disabling Death Upon Reset

How would I go about making the player not taking damage/dying after resetting? I’ve tried doing it through the bindable event thing but it did not work.

1 Like

You can use StarterGui:SetCore("ResetButtonCallback", false) to disable the functionality of the reset button overall.

1 Like

This is the script I’m using and I also don’t want to disable it entirely.

local resetBindable = Instance.new("BindableEvent")
resetBindable.Event:Connect(function()
	game.ReplicatedStorage.Events.HandlerEvent:FireServer("Respawn")
end)

local successReset = false

coroutine.wrap(function()
	while not successReset do
		successReset = pcall(function()
			game:GetService("StarterGui"):SetCore("ResetButtonCallback", resetBindable)
		end)
		if successReset then
			break
		end
		task.wait(.2)
	end
end)()

return CC
1 Like

what script is this? LocalScript, ServerScript, ModuleScript?

1 Like

Localscript in any of the viable places where a localscript would run on player join.

1 Like

It’s a modulescript located in replicatedstorage.

1 Like

So is anyone able to assist me with this or not?

1 Like
local bind = Instance.new("BindableEvent")
bind.Event:Connect(function() -- Empty anonymous function
  print("Busy wait") 
end)

game:GetService("StarterGui"):SetCore("ResetButtonCallback", bind) -- Bind the reset to the BindableEvent, which does nothing

That should make the death script functionally useless

1 Like

Thank you so much, and where would I place the script at because currently the script is located inside of ReplicatedStorage inside of a ModuleScript.

1 Like

SetCore only works on the client, just place it in a LocalScript

A good place for the script itself is in StarterPlayerScripts

1 Like

Also just an FYI, you may have to do some pcall checks to ensure the core is loaded, if it’s not that script can throw an error

1 Like

You can use humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false) to basically un-dead the player after they die, even if their health is 0. Example:

local starterGui = game:GetService("StarterGui")

local hum = -- Path to humanoid

local resetBind = Instance.new("BindableEvent")

starterGui:SetCore("ResetButtonCallback", resetBind)

local function onResetBind()
    hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
end

resetBind.Event:Connect(onResetBind)

If, after this, your character dies again after taking damage a second time, just set up a humanoid.Died connection that sets Dead to false and disconnects when the player finally respawns.

2 Likes

This was the only one that worked for me, ty