-- Update camera if it changes


workspace.Changed:connect(function (p)
if p == "CurrentCamera" then
camera = workspace.CurrentCamera
end
end)


coroutine.resume(coroutine.create(function()
rs.Stepped:connect(function()
Indicator:updateAll()
rs.RenderStepped:wait()
end)
end))


lastHealth = 100
damagedone = 100

function AnimateHurtOverlay()
if humanoid then
if humanoid:FindFirstChild("creator") then
if humanoid:FindFirstChild("creator").Value then
if humanoid:FindFirstChild("creator").Value.Character then
if humanoid:FindFirstChild("creator").Value.Character:FindFirstChild("Torso") then
Indicator:new{}
end	
end
end
end
end
end


function healthGUIUpdate(health)
	
damagedone = lastHealth-health

if humanoid.Health ~= humanoid.MaxHealth and damagedone>0 then	
delay(0,function()
AnimateHurtOverlay()
end)
end

lastHealth = health

end


character.Humanoid.HealthChanged:connect(function(health)
healthGUIUpdate(health)
end)
