So Ive been searching the web for about half an hour and I cant seem to find anything. I was wondeing if anyone knew how to enable and disable immortality?
Have you tried force shield?
https://developer.roblox.com/en-us/api-reference/class/ForceField
Or try locking the health value in a variable and when health changes, turn the health to that value again (and disable death).
Try using the Changed
event:
local immortalityEnabled = true game.Players.PlayerAdded:Connect(function(player) local CharHumanoid = player.Character if immortalityEnabled then CarHumanoid.Changed:Connect(function(property) if property == "Health" then CharHumanoid.Health = 100 end end end) end)
I hope this helps!