Credits to Goulstem How would I make this script slow down before it his the max/min value and then speed up when it goes away?

local wag = 1; --number
local bool = false; --bool switch
local MIN,MAX = -33,33 --bounds
while true and wait() do
    if wag < MIN or wag > MAX then
        bool = not bool --switch the bool
    end
    wag = (bool and wag + 1) or wag - 1
print(wag)
end

3 comments

0

You don't require the "true" for an argument for the while loop, and wait() will return true anyway; as for having it slow down, you could have it so that the wait time is slowed based upon the increasing value, or something like that.

0

im not a good scripter so that would be hard

0

True, I'm also not familiar with how to have it slow after a specific amount of values. ;/ Apologies. ;c