#bro i cant get offline players playtime to work (disky)

1 messages · Page 1 of 1 (latest)

nimble anchor
#

its probably so basic tier knowlage but im just supernew to skript and i read the docs and stuff i just cant figure out why for offline players the playtime is <none>

discord command sstats <offlineplayer>:
    prefixes: /
    trigger:
        set {_p} to arg-1

        if {_p} is not set:
            reply with "A player with that name has never joined this server."
            stop

        set {_online} to {_p}'s name parsed as player

        if {_online} is set:
            set {_minutes} to tagPlayMinutes({_online})
            set {_playtime} to tagFormatMinutes({_minutes})
        else:
            set {_seconds} to time played of {_p}

            if {_seconds} is not set:
                reply with "A player named **%{_p}%** has never joined this server."
                stop

            set {_hours} to floor({_seconds} / 3600)
            set {_playtime} to "%{_hours}% hours"

        set {_kills} to value of placeholder "statistic_player_kills" from {_p}
        set {_deaths} to value of placeholder "statistic_deaths" from {_p}

        reply with "**Stats for %{_p}%:**"
        reply with "⚔️ Kills: %{_kills}%"
        reply with "💀 Deaths: %{_deaths}%"
        reply with "⏰ Playtime: %{_playtime}%"
nimble anchor
#

nvm i got it with this:

#
discord command sstats <offlineplayer>:
    prefixes: /
    trigger:
        set {_p} to arg-1

        if {_p} is not set:
            reply with "A player with that name has never joined this server."
            stop

        set {_playtime} to placeholder "ajlb_value_statistic_hours_played_alltime" for {_p}

        if {_playtime} is not set:
            reply with "A player named **%{_p}%** has never joined this server."
            stop

        set {_kills} to value of placeholder "statistic_player_kills" from {_p}
        set {_deaths} to value of placeholder "statistic_deaths" from {_p}

        reply with "**Stats for %{_p}%:**"
        reply with "⚔️ Kills: %{_kills}%"
        reply with "💀 Deaths: %{_deaths}%"
        reply with "⏰ Playtime: %{_playtime}% hours"
quaint plank
#

what? you are using discord command with prefix /

#

on ready:
set {_cmd} to a new slash command

on slash command:

#

and why not use bee statics syntax

white wraith
#

I have already told you this