Jump to content
Sign in to follow this  
Twenjooooooooooo

Basic playtime SKRIPT

Recommended Posts

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 ""

 

Edited by Twenjii

Share this post


Link to post
Share on other sites
26 minutes ago, Twenjii said:

 

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 ""

At least put it in code blocks...


image.png.85473cf30121df1d6ba06681761d653a.png 

image.png.13ee45b7c47718e9809398a9aa4462cc.png

 

Share this post


Link to post
Share on other sites

.

Edited by TacticalModz

I've been doing skript for 4 years. I don't find my self a "better" skripter or do competitions against others.

I just wish people can just get along & just help each out and be kind to one and another.

 

I have been hosting ValkNet for 5 years

ever since 2015 when i joined minehut around February or January.

 

I'm the owner of ValkyrieNetwork (known as ValkNet) | https://discord.gg/rPTYbQY

A great service that i provide for the minehut community!

 

Contact:

Discord: https://discord.gg/rPTYbQY

Share this post


Link to post
Share on other sites
6 minutes ago, Youtubejr said:

 Ye, change %player% with %uuid of player%

changing %player% to %uuid of player% would just broadcast the players uuid you keep %player% and change %player's uuid% to %uuid of player%

Share this post


Link to post
Share on other sites
2 hours ago, XXXCanadian said:

changing %player% to %uuid of player% would just broadcast the players uuid you keep %player% and change %player's uuid% to %uuid of player%

Told you I forgot a lot 😬

Share this post


Link to post
Share on other sites
16 hours ago, XXXCanadian said:

changing %player% to %uuid of player% would just broadcast the players uuid you keep %player% and change %player's uuid% to %uuid of player%

That's why you display it as %{yourvariable::%player's uuid%}%

Share this post


Link to post
Share on other sites

here's a non bad version of this

every second:
    loop all players:
        add 1 second to {playtime::%loop-player's uuid%}

function time(t: text) :: text:
    set {_n} to {_t}
    replace all " seconds" and " second" with "s" in {_n}
    replace all " minutes" and " minute" with "m" in {_n}
    replace all " hours" and " hour" with "h" in {_n}
    replace all " days" and " day" with "d" in {_n}
    replace all " and " with " " in {_n}
    return {_n}

command /playtime [<offlineplayer>]:
    trigger:
        set {_p} to arg 1 ? player
        set {_u} to {_p}'s uuid
        if {playtime::%{_u}%} is not set:
            send "&cThat user is not registered."
        else:
            set {_time} to time("%{playtime::%{_u}%}%")
            send ""
            send " &3%{_p}'s playtime: &7%{_time}%"
            send ""

 

  • Thanks 1

Discord: MrScopes#5548

Share this post


Link to post
Share on other sites
2 hours ago, MrScopes said:

here's a non bad version of this


every second:
    loop all players:
        add 1 second to {playtime::%loop-player's uuid%}

function time(t: text) :: text:
    set {_n} to {_t}
    replace all " seconds" and " second" with "s" in {_n}
    replace all " minutes" and " minute" with "m" in {_n}
    replace all " hours" and " hour" with "h" in {_n}
    replace all " days" and " day" with "d" in {_n}
    replace all " and " with " " in {_n}
    return {_n}

command /playtime [<offlineplayer>]:
    trigger:
        set {_p} to arg 1 ? player
        set {_u} to {_p}'s uuid
        if {playtime::%{_u}%} is not set:
            send "&cThat user is not registered."
        else:
            set {_time} to time("%{playtime::%{_u}%}%")
            send ""
            send " &3%{_p}'s playtime: &7%{_time}%"
            send ""

 

bruh

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...