Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My no health regeneration script is not working! Is there something wrong?

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.

1 comment

0

math.floor()?

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.