Page 1 of 1

minTimer.lua - Mini game timer from superstar saga! [v1]

Posted: Thu Nov 17, 2022 9:23 am
by Marioman2007
Another lib I did when I got bored

GIF
Spoiler: show
Image

Credits
Me
Enjl

Download
https://drive.google.com/file/d/1gLskpp ... sp=sharing

Documentation in luna.lua file, check the top of the lib for other settings.
Usage example included.

Enjoy and please give credits!

Re: minTimer.lua - Mini game timer from superstar saga! [v1]

Posted: Thu Nov 17, 2022 10:14 am
by AirShip
I had made a script similar to this one for my episode, good to know that now there is an optimized and less complicated version to use, good job.

Re: minTimer.lua - Mini game timer from superstar saga! [v1]

Posted: Thu Nov 17, 2022 12:36 pm
by Mal8rk
Bro you just keep making more and more banger scripts! Thanks for making this!

PD: Is there a way to make the player die if they fail?

Re: minTimer.lua - Mini game timer from superstar saga! [v1]

Posted: Thu Nov 17, 2022 9:09 pm
by Marioman2007
Mal8rk wrote:
Thu Nov 17, 2022 12:36 pm
PD: Is there a way to make the player die if they fail?

The onEnd function runs when a timer reaches 0, so you could do:

Code: Select all

function timer1:onEnd(win) -- win is true if the timer closes before the it reaches 0
    if not win then
        player:kill()
    end
end

Re: minTimer.lua - Mini game timer from superstar saga! [v1]

Posted: Sun Feb 05, 2023 4:05 am
by ElTipsta
is there a maximum time limit this can be set to? if not, it could be used for full length level time challenges, which would be great :)

Re: minTimer.lua - Mini game timer from superstar saga! [v1]

Posted: Sun Feb 05, 2023 5:39 am
by Marioman2007
ElTipsta wrote:
Sun Feb 05, 2023 4:05 am
is there a maximum time limit this can be set to? if not, it could be used for full length level time challenges, which would be great :)
It supports 2 types of timers:
- minTimer.COUNT_DOWN: for challenges, counts down until it reaches 0 and passes a lua event to handle its onEnd function.
- minTimer.COUNT_UP: for timers, counts only up, useful for checking how much time a player spent into something.

And yes, you can set starting values for timers that count down, but you can't set a limit for counters that count up. Might make it a feature in the future.