How to make health value stay where it is with while loop?
Asked by
6 years ago Edited 6 years ago
I'm trying to make a block damage on R. It continually puts the health back where it was, kinda like loopheal except it doesn't heal you. I don't want it to be like ff, where the damage is completely negated, so that if someone blocking with 30 hp takes 30 damage they die even if they're blocking. This is my attempt.
01 | uis.InputBegan:connect( function (input) |
02 | if input.KeyCode = = Enum.KeyCode.R then |
03 | script.Parent.Parent.blocking.Value = true |
04 | while script.Parent.Parent.blocking.Value = = true do |
06 | hp = c.Humanoid.Health |
08 | c.Humanoid.Health = hp |
10 | if blocking = = false then return end |