1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Timer Variable.

Discussion in 'Skript' started by ClashCat7, Aug 4, 2020.

Thread Status:
Not open for further replies.
  1. ClashCat7

    ClashCat7 Member

    Joined:
    Jun 30, 2020
    Messages:
    2
    Likes Received:
    0
    Hey so i'm trying to make a /fly command that you can only use for 20 mins every 1 hour but toggle on and off.
    I'm struggling with the variable that shows how much time they've got left until the 1 hour cooldown. Can someone help me?

    This is what i have so far:
    command /fly:
    trigger:
    set {silverflighttime} to 20 minutes
    if {%player%::emoji_astonished:n.off} is off:
    if player has permission "silver.fly":
    if {%player%::silverflyfirst} is 0:
    if {%player%::silverfly} is 0:
    send "e"
    set {%player%::emoji_astonished:n.off} to on
    set player's flight mode to true
    set {flighttime::%player%} to now
    set {difference} to difference between {flighttime::%player%} and now
    set {remaining.time} to difference between {difference} and 20 minutes
    send "&3Clash&bCraft &8| &bFly &7has been &aenabled&7. You have &b%{remaining.time}% &7time left of fly."
    set {%player%::silverflyfirst} to 1
    wait {silverflightime}
    set {%player%::silverfly} to 1
    if {%player%::emoji_astonished:n.off} is on:
    set player's flight mode to false
    send "&3Clash&bCraft &8| &7You have run out of &bfly. &7Please wait 1 hour until using it again."
    wait 1 hour
    set {%player%::silverflyfirst} to 0
    set {%player%::silverfly} to 0
    if {%player%::emoji_astonished:n.off} is off:
    send "&3Clash&bCraft &8| &7You have run out of &bfly. &7Please wait 1 hour until using it again."
    wait 1 hour
    set {%player%::silverflyfirst} to 0
    set {%player%::silverfly} to 0
    stop
    if {%player%::silverflyfirst} is 1:
    if {%player%::silverfly} is 0:
    set {%player%::emoji_astonished:n.off} to on
    set player's flight mode to true
    send "&3Clash&bCraft &8| &bFly &7has been &aenabled&7. You have &b%{remaining.time}% &7time left of fly."
    stop
    if {%player%::emoji_astonished:n.off} is on:
    if player has permission "silver.fly":
    if {%player%::silverflyfirst} is 1:
    if {%player%::silverfly} is 0:
    set {%player%::emoji_astonished:n.off} to off
    set player's flight mode to false
    send "&3Clash&bCraft &8| &bFly &7has been &cdisabled&7. You have &b%{remaining.time}% &7time left of fly."
    on join:
    if {%player%::silverflyfirst} is not set:
    set {%player%::silverflyfirst} to 0
    on join:
    if {%player%::silverfly} is not set:
    set {%player%::silverfly} to 0
    on join:
    if {%player%::emoji_astonished:n.off} is not set:
    set {%player%::emoji_astonished:n.off} to off

    Any help is appreciated
     
  2. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    196
    Likes Received:
    4
    Can you please send it as a code?
    Screenshot_4.png
     
Thread Status:
Not open for further replies.

Share This Page

Loading...