does anyone know why this script wont work
local hitbox = script.Parent
local cd = Instance.new("ClickDetector", hitbox)
local health = 10
script.Parent.ClickDetector.MouseClick:Connect(function()
health -= 1
print(health)
end)
if health <= 0 then
hitbox.Position = Vector3.new(0,1,0)
end
the first part works where it takes away each health on click and prints it right but whenthe health = 0 it doesent move