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.
uis.InputBegan:connect(function(input)--Block
if input.KeyCode == Enum.KeyCode.R then
script.Parent.Parent.blocking.Value = true
while script.Parent.Parent.blocking.Value == true do
wait()
hp = c.Humanoid.Health
wait(0.1)
c.Humanoid.Health = hp
wait()
if blocking == false then return end
end
end
end
end
end)

3 comments
What's "hp" defined as?
hp = Humanoid.Health. Basically I tried to make it say "Current Health = Current Health".
im not sure whats what on the script, as the script is a bit messy, could you maybe explain it a bit more?