What do you want to achieve? Trying to make a custom reset system.
What is the issue? The problem is that the code never runs.
What solutions have you tried so far? Try changing the code some bit and the code still will not run when the player resets.
I just want this code to work because this is suppose to fire when the player resets.
-- Local script
local player = game.Players.LocalPlayer
local resetBindable = Instance.new("BindableEvent")
resetBindable.Event:connect(function()
-- Implement custom reset logic here
-- It never prints lol and no errors at all
print("Lol")
end)
-- This will remove the current behavior for when the reset button
-- is pressed and just fire resetBindable instead.
game:GetService("StarterGui"):SetCore("ResetButtonCallback", resetBindable)
-- Setting ResetButtonCallback to false will grey out the reset button
-- in the menu and players won't be able to reset in your game.
game:GetService("StarterGui"):SetCore("ResetButtonCallback", true)
Oh so you just connect a local function. I know about local functions I use them a lot in my games just didn’t know that the old code was that broken. Thanks!