Hello!
I have a skript thats supposed to senda playtime leaderboard (using player's time played rather than storing playtime by counting every second)
command /playtimeleaderboard:
trigger:
loop all offline players:
set {_t} to "%loop-offline player's time played%"
replace all " days" in {_t} with "d"
replace all " day" in {_t} with "d"
replace all " hours" in {_t} with "h"
replace all " hour" in {_t} with "h"
replace all " minutes" in {_t} with "m"
replace all " minute" in {_t} with "m"
replace all " seconds" in {_t} with "s"
replace all " second" in {_t} with "s"
replace all " and" in {_t} with ""
add "%{_t}% | %loop-offline player%" to {_entries::*}
set {_sorted::*} to sorted {_entries::*}
loop reversed {_sorted::*}:
set {_parts::*} to loop-value split at "|"
send "%loop-counter%. %{_parts::2}% - %{_parts::1}%" to player
if loop-counter >= 10:
stop
The issue is that it doesn't sort properly (out of order) because it takes 19h to be greater than 1 day as its no longer parsed as a timespan (I think), I would appreciate a possible fix avoiding just storing playtime in a conventional way