I want the character’s health to tween to 1 when they reset instead of killing them which breaks my other scripts. Now, I can disable it entirely providing another button in-game to do the same thing but it will cover the players’ screen unnecessarily.
Is there a way I could configure the reset button to my requirements?
I think fixing this should be your priority, but if you really want a workaround then call StarterGui:SetCore with "ResetButtonCallback" as the first argument and a BindableEvent as a second.
I tried a lot to fix it but when I reset, it does more than just than changing Health to 0 which breaks my scripts. When I started triggering my scripts on 1 health, it works fine.
Edit: It doesn’t actually break them, they just keep functioning over and over.
Like, if i tween their health to 100 after it has become 0, it works fine. After tween has ended, it becomes 0 again. It’s like player has died and can’t be revived after being reset and only way is LoadCharacter().
Non-Reset Situation: When a player falls and goes beyond a certain limit, I turn his health as 0 then I check if his health is 0. After that I make it 1 immediately so the OOF sound doesn’t come and everything works perfectly.
Reset Situation: It also changes it health to 0 but the OOF sound comes this time and his health goes back to 0 every time after tweening to 100. Same thing happens when I change Humanoid’s Health from command bar. OOF sound comes and it messes up.
Well, it’s not the reset button. I just found out that Humanoid’s health is changing to 0 after it tweens to 100 which results in an infinite loop when I pass a command from Command Bar to change its health to 0 which is the same thing as resetting.
This gif shows it better:
Seems like if you might need to created a NumberValue that acts as an Humanoid Health instead of humanoid health itself. So in that case you can check if the NumberValue value reaches 0, if so set the humanoid health to 1 or something like that and tween it back up to 100?
Oh and once the humanoid health reaches 0 it will check itself as died which makes all of the additional health reduce back to 0.
Sorry if my explanation is a bit weird I’m not good at English.
When you set humanoid’s health to 0 it becomes ‘dead’, prevents you from increasing its health back, and the 5 seconds respawn time is triggered.
There probably is a way around that, like setting CharacterAutoLoads to false and recreating broken joints or something, but a simpler solution would be overriding the reset button behaviour so that it sets health to 1 instead of 0, like @sjr04 suggested