Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to dampen a value but also do the reverse?

Asked by
816i 19
7 years ago

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
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. TheeDeathCaster 2368 — 7y
0
im not a good scripter so that would be hard 816i 19 — 7y
0
True, I'm also not familiar with how to have it slow after a specific amount of values. ;/ Apologies. ;c TheeDeathCaster 2368 — 7y

Answer this question