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%:n.off} is off:
if player has permission "silver.fly":
if {%player%::silverflyfirst} is 0:
if {%player%::silverfly} is 0:
send "e"
set {%player%: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%: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%: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%: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%:n.off} is on:
if player has permission "silver.fly":
if {%player%::silverflyfirst} is 1:
if {%player%::silverfly} is 0:
set {%player%: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%:n.off} is not set:
set {%player%:n.off} to off
Any help is appreciated
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%:n.off} is off:
if player has permission "silver.fly":
if {%player%::silverflyfirst} is 0:
if {%player%::silverfly} is 0:
send "e"
set {%player%: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%: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%: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%: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%:n.off} is on:
if player has permission "silver.fly":
if {%player%::silverflyfirst} is 1:
if {%player%::silverfly} is 0:
set {%player%: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%:n.off} is not set:
set {%player%:n.off} to off
Any help is appreciated