Menu
Login
Language
DE EN FR ES IT CZ
Back

get os.time or timer with lua

  • #1, by andy-rinaldi Tuesday, 17. February 2015, 20:11 11 years ago Quote
    Hello,
    I need to show a simple timer or os.time in my scene but I don't know like do it and the variable type.
    number type: v=variable
    string type: vs=variable
    time type: ???

    thanks.

    Forum Fan

    160 Posts

  • #2, by afrlme Tuesday, 17. February 2015, 20:27 11 years ago Quote
    There is no time type for the displayed texts. You can only include the integer or string value of an existing value. You could write the time into a value though. The string section of a value would be better than the integer section as you would be able to include formatting.

    What is this timer for?

    os.date("%X") -- return players os time in 24 hour format (hh:mm:ss)
    

    Imperator

    7290 Posts

  • #3, by andy-rinaldi Tuesday, 17. February 2015, 22:28 11 years ago Quote
    Hi Lee, it's your timer script that not works grin. When I quit the option menu, the timer resets to 0 every time.

    Forum Fan

    160 Posts

  • #4, by afrlme Tuesday, 17. February 2015, 22:37 11 years ago Quote
    Ah that old chestnut again eh! grin

    I wrote that script ages ago. Not sure why it should be resetting itself though, unless you are reinitializing the script by calling it each time you load the menu scene.

    Imperator

    7290 Posts