local debounce = false
local value = script.Parent.Parent.Parent.Energy
(subtraction detection here)
if not debounce then debounce = true
script.Parent.Transparency = 0.5
wait(0.05)
script.Parent.Transparency = 0.6
wait(0.05)
script.Parent.Transparency = 0.7
wait(0.05)
script.Parent.Transparency = 0.8
wait(0.05)
script.Parent.Transparency = 0.9
wait(0.05)
script.Parent.Transparency = 1
wait(0.05)
script.Disabled = true
end
Im trying to get this script to run only when an intvalue's number was reduced but I dont know exactly how to set this up.

1 comment
Check waffles answer, sounds like its what you need.