Solved How to set a variable to the amount of seconds in another variable?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

SubSplash

Member
Oct 11, 2023
22
1
3
Hello! I need help setting a variable to the amount of seconds in another variable, for example:

Code:
every 1 second:
  loop all players:
    if {timer.toggled::%loop-player's uuid%} is true:
      add 1 second to {timeinseconds::%loop-player's uuid%}


command /converttimeintonumbers:
  permission: SS.buildtimer
  trigger:
    set {_timeinnumbers} to amount of seconds in {timeinseconds::%player's uuid%}
    send "%{_timeinnumbers}%" to player

Error: Can't understand this expression 'amount of seconds in {timeinseconds::%player's uuid%}'
 
SkBee has a way to get the seconds of a timespan (your {timeinseconds::%player's uuid%} variable)

Additionally, if you are not pausing this timer I would recommend setting your variable to now when you start the timer. When you want to see how much time has passed since the timer started all you would have to do is set {_timespan} to difference between <your variable> and now. This would give you a timespan and you could use the same skbee expression to get the seconds from it.
 
SkBee has a way to get the seconds of a timespan (your {timeinseconds::%player's uuid%} variable)

Additionally, if you are not pausing this timer I would recommend setting your variable to now when you start the timer. When you want to see how much time has passed since the timer started all you would have to do is set {_timespan} to difference between <your variable> and now. This would give you a timespan and you could use the same skbee expression to get the seconds from it.
Thank you for the help.