Jump to content

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
Link to comment
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...

Graphic Designer - Skript Developer - Professional Builder - Content Creator

Been on Minehut since January 2018. Throughout my time here I've mastered the skills you see above. I make free logos, banners, and server art for users on Minehut. I'm a proficient Skript developer. I'm also really good at building, you can see my portfolio by clicking here. Feel free to say hi if you see me somewhere 🙂

Amethyst Studios Discord

Link to comment
Share on other sites

2 hours ago, Twenjii said:

And how do you do that in the new forums? @Farwl

image.png.715c7db2c461fa9a5ad19961289bde55.png

Graphic Designer - Skript Developer - Professional Builder - Content Creator

Been on Minehut since January 2018. Throughout my time here I've mastered the skills you see above. I make free logos, banners, and server art for users on Minehut. I'm a proficient Skript developer. I'm also really good at building, you can see my portfolio by clicking here. Feel free to say hi if you see me somewhere 🙂

Amethyst Studios Discord

Link to comment
Share on other sites

.

Edited by TacticalModz

Start your Minecraft server today for as low as £0.50/weekly for up to 4 GB of RAM! (£3.50 Monthly) and be equipped for all situations with our high-performance gear keeping your servers running 24/7

Why choose Us?
• Guaranteed 99.9% Uptime
• NVMe RAID Fast Storage
• 24/7 Hosting
• Instant Setup
• 50% Discount. Use Code: 50OFF (Ends on November 11th)

We want to ensure our customers are happy with the service they received and support. We aim to provide low-costs those who cant afford a minecraft server. No extra costs, no setup fees! One-time payment and you are good to go with our instant setup feature we introduced to ensure your server is ready to go!

Planning to make a community or a project you want to work on? We got you covered! Our servers are optimized for performance and security, so you can have peace of mind and focus on your project. Our servers are also reliable and packed with features, so you can start playing right away.

We guarantee 99% uptime and 24/7 customer support, so you can always ask for help if you need it.

Links:
https://forums.valknet.org
https://billing.valknet.org
Invite: https://discord.gg/FqSRt4ZCAC

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 4 weeks later...

@MrScopes is some kind of god at skript.

  • Like 1

 

like.gif.653e1b24da93a6ca10eaf5b04e7f0242.gif

Likes are appreciated ❤️

 

Username: SuperOrca

Discord: Link to Profile

Rank: [VIP]

Joined Minehut: August 10, 2017

Joined Forums: June 10, 2019

 

Experienced in Python, Java (mainly spigot), Javascript (node.js, basics of react.js), and Web Development. DM on discord me if you want a custom discord bot for your server (i'm bored).

Link to comment
Share on other sites

  • 1 year later...
On 6/18/2019 at 6:17 AM, 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 ""

 

I tried this skript and it didn't work. I did /playtime and it gave me 2 blank lines. Can you send me a working one please?

Link to comment
Share on other sites

  • 1 month later...
18 hours ago, emopediaMC said:

can someone pls lock for necro

You're the one that just necro'd...

⁃ Owner of Shulked
Skript Developer ⁃

DEFAULT / 2018
[VIP] / 2019

DISCORD: Cosmos#2576 ⁃
IGN: Stuudium (soon to change) ⁃

- *former* ADMIN on Versa Realms -
-
MODERATOR on EddyEvents -


85ae165db1ccfa5faf3937bda91316da-png.jpg.2508c19c38e80ab6cd03fd909b03a9b4.jpg
signature.gif.ae17aaf0a0cfdc3515d822c66c2a0056.gif.65475d1df01fa6283bf9c3cdb19c7b97.gif

Link to comment
Share on other sites

  • 2 months later...

Locked - Necroposting

Please avoid posting on threads that have been inactive for over a month. Also, next time I'd advise you use our in-built report system instead of bumping old threads and tagging moderators.

Support  July 29, 2020 → November 3, 2020

► Helper November 3, 2020 → February 22, 2021

► Moderator February 22, 2021 → May 17, 2021

 I might not always respond to forum dms, however I am always contactable on discord (mig#0069)

Screen Shot 2020-03-20 at 5.23.33 pm.png

Link to comment
Share on other sites

  • Migins locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...