#Playtime help

1 messages · Page 1 of 1 (latest)

pine furnace
#
every second:
    loop all players:
        add 1 to {s::%loop-player's uuid%}
        if {s::%loop-player's uuid%} > 59:
            remove 60 from {s::%loop-player's uuid%} 
            add 1 to {m::%loop-player's uuid%}
        if {m::%loop-player's uuid%} > 59:
            remove 60 from {m::%loop-player's uuid%}
            add 1 to {h::%loop-player's uuid%}
        if {h::%loop-player's uuid%} > 23:
            remove 24 from {h::%loop-player's uuid%}
            add 1 to {d::%loop-player's uuid%}

command /playtime [<offlineplayer>]:
    trigger:
        arg isn't set:
            wait 1 tick
            send ""
            send "&f&l    YOUR PLAYTIME (&7&l%player%&f)"
            send ""
            send "&f&l  SECONDS:&7 %{s::%player's uuid%}%"
            send "&f&l  MINUTES:&7 %{m::%player's uuid%}%"
            send "&f&l  HOURS:&7 %{h::%player's uuid%}%"
            send "&f&l  DAYS:&7 %{d::%player's uuid%}%"
            send ""
        else:
            wait 1 tick
            send ""
            send "&f&l    PLAYTIME OF &7&l%arg%"
            send ""
            send "&f&l  SECONDS:&7 %{s::%arg's uuid%}%"
            send "&f&l  MINUTES:&7 %{m::%arg's uuid%}%"
            send "&f&l  HOURS:&7 %{h::%arg's uuid%}%"
            send "&f&l  DAYS:&7 %{d::%arg's uuid%}%"
            send ""
abstract tendon
#

hm

#

you could loop all players while they are online

#

add that to a var

#

and then set {m::%arg's uuid%} to that var divided by 60

#

and so on and so forth

#

but idrk

fresh phoenix
#

thats pretty cool

hollow tulip
#

wdym

#

explain

hybrid shuttle
#

gonna make server lag so hard

#

just do

#
  while player is online:
    add 1 to (seconds variable here)
    wait 1 second```
abstract tendon
abstract tendon
#

was meant to reply to this

hybrid shuttle
#

u said loop all players

#

are u tryna crash the server lol

sacred fossil
#

then do the math when checking playtime

simple jolt
#

command /playtime:
trigger:
if {_time.%player%} is not set:
set {_time.%player%} to 0
set {_time} to {_time.%player%} + (time elapsed since {_last.%player%})
set {_hours} to floor({_time} / 3600)
set {_minutes} to floor(({_time} - {_hours} * 3600) / 60)
set {_seconds} to {_time} - ({_hours} * 3600 + {_minutes} * 60)
message "&6You have played for &b%{_hours}% hours &6, &b%{_minutes}% minutes &6 and &b%{_seconds}% seconds&6 on this server."

devout sentinel
#

could just add 1 second to {playtime::%player%} then skript will automatically display the hours, minutes, etc for you when you use the variable

stark quartz
#

Cant you just use the played time expression from skript SnivySip

eternal forum
#

time played of %offlineplayers%

#

example: time played of player

devout sentinel
#

I used variables so I could sort