#Run line only if attribute is greater than last time it was checked

1 messages · Page 1 of 1 (latest)

tawdry sandal
#
char:GetAttributeChangedSignal("Blocking"):Connect(function()
    Bar:TweenSize(UDim2.new(char:GetAttribute("Blocking")/100,0,1,0), Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,.3)
    ShakeModule.ShakeOnce(MainFrame,MainFrame,5,.2,0,.1)
    MainFrame.Visible = true
    
    if char:GetAttribute("Blocking") == 0 then
        MainFrame.Visible = false
    end
end)

how would i make the "ShakeModule.ShakeOnce()" line only apply if the Blocking attribute is larger than last AttributeChangedSignal

sage pike
tawdry sandal
sage pike
tawdry sandal
#

the argument of the if statement..

sage pike
#

Blocking attribute (priority) is higher than last attribute?

tawdry sandal
#

i want the module to shake the UI only when Blocking > lastBlocking

torn coral
tawdry sandal
#

yea idk how to do the lastblocking

#

maybe a variable set intially to nil and then set it at the end of the script to the blocking value but then the first check would get an error

torn coral
tawdry sandal
#

i think i figured it out