While making a game I was testing my custom health bar GUI. I set my health to something lower than 100 and it started to eventually get back to 100, I would be fine with it if it didn't get funky with a lot of decimals. So I made this script to try to delete the health regeneration script, but it's not working!
function deleteRegenScript(player) player.Character:WaitForChild'Health':Destroy() end game.Players.LocalPlayer.CharacterAdded:connect(deleteRegenScript)
Help would be appreciated.
Here, try this,
Server script located in ServerScriptService:
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) if char then local healthScript = char:WaitForChild("Health") healthScript:Destroy() -- you can also disable the script using healthScript.Disable = true end end) end)