Hello everyone,
I am using a custom health system. I am trying to override the reset button so I can set my own health to 0. Generally, it works. But once in awhile, this will not work and when you press reset it will reset you with the Roblox default system. This probably happens 1/15 times. Obviously, this system can not work if this happens rarely. Here is the code I am using.
local coreCall do
local MAX_RETRIES = 8
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', remotes.resetBind))
What could I do to make this work every time and why is it not?