Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to check if a number rise alot under a short period of time?

How do I check if a number rise alot under a short period of time?

2 comments

0

guess you could have a function add up the number of changes a number undergoes(upward) and use an if statement to create a message when the number jumps so much. You'd have the variable counter reset every few seconds.(not sure of easier way lol)

0

How much is "a lot"

1 answer

✓ Accepted answer

You could check the rate a number is changing per second using a coroutine fairly easily with something like

local numberVal -- The value that's changing
local rate = coroutine.create(
    function()
        local start = numberVal
        wait(1)
        local finish = numberVal
        print("The number value is changing at " .. tostring(finish - start) .. " unit<s> per second.")
    end
)

This discussion is preserved as it was. New answers, comments, and votes are closed.