So I was creating this script in which the player's camera will shake every time they take damage. It works, but the thing is that when the player regenerates health, the camera shake plays.
I couldn't think of a better way of making this portion of the script, so I decided I would completely halt the player's regeneration.
Here is my portion of the script, if you would like to fix/polish off-topic.
--the variables are already set for this portion
humanoid.HealthChanged:Connect(function()
for i = 1,5 do
humanoid.CameraOffset = Vector3.new(x,y,z)
wait()
end
humanoid.CameraOffset = Vector3.new(0,0,-1)
end)
So if you have any suggestions/answers, feel free to answer my question. I really need it.

2 comments
cool
Thank you for responding! You fixed my question like a boss. Really appreciated, thanks again.