Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I know if a player has reset and not died from another cause?

Asked by 4 years ago

I have tried with a simple .Died event, but how do I know if the player reset? Is there a callback?

1 answer

Log in to vote
1
Answered by
Elixcore 1337 Moderation Voter
4 years ago
Edited 4 years ago

If you look at SetCore

You are able to see "ResetButtonCallback"

You can assign it either a bool (false to disable reset) or a bindableEvent callback to execute whenever the player requests it.

Here's an example of how to use it.

local reset = Instance.new("BindableEvent")
reset.Event:connect(function()
    print("Reset Requested")
end)

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

everytime the player tries to reset, it will print out 'Reset Requested'

Ad

Answer this question