how would i detect if i took damage?
You would need to use :GetPropertyChangedSignal()
local health = 100 player.Character.Humanoid:GetPropertyChangedSignal("Health"):Connect(function() if player.Character.Humanoid.Health < health then -- code goes here end health = player.Character.Humanoid.Health end)
This will only fire if the humanoid health is LOWERED (aka damaged).
You could also do
Humanoid.HealthChanged:Connect(function() -- code end
this way you can fire a function whether the health goes up or down