Timer Variable.

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ClashCat7

Member
Jun 30, 2020
2
0
0
21
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
 
Can you please send it as a code?
Screenshot_4.png
 
Status
Not open for further replies.