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.

Skript cooldown cancel if player leaves inventory

Discussion in 'Skript' started by GamingCarmelo, Mar 30, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. GamingCarmelo

    GamingCarmelo New Member

    Joined:
    Mar 1, 2021
    Messages:
    2
    Likes Received:
    0
    I currently have a /warps skript with several warps with a cooldown of 30 minutes everytime someone uses this command. But my issue is if someone was to leave this inventory, the cooldown would still start. Anyone know how to fix this? also I tried adding cooldown cancel after send "&cCould not teleport you to Europe" to player but it didn't work. Anyone know how I can add a cooldown cancel if the else statement happens?

    My questions:
    1) How to add a cooldown cancel when a player exits the inventory gui
    2) How to add a cooldown cancel when the else statement happens
    Code (Text):
    1. command /warps:
    2.     cooldown: 30 minutes
    3.     cooldown message: &ePlease wait %remaining time% to use /warps again
    4.     trigger:
    5.         open virtual chest with 1 rows named "&a&lWarps" to player
    6.         format gui slot 1 of player with Grass block named "&aEurope" to run:
    7.             send "&aStand still for 3 seconds to be teleported to Europe"
    8.             close player's inventory
    9.             set {_x} to x-coords of player
    10.             set {_z} to z-coords of player
    11.             wait 3 seconds
    12.             set {_x-now} to x-coords of player
    13.             set {_z-now} to z-coords of player
    14.             if {_x-now} = {_x}:
    15.                 if {_z-now} = {_z}:
    16.                     send "&aYou have successfully been teleported to Europe"
    17.                     teleport player to location 3752, 123, -10560 in world "GCEarth"
    18.                 else:
    19.                     send "&cCould not teleport you to Europe" to player
    20.                     stop
     
  2. msconfig32

    msconfig32 Member

    Joined:
    Nov 10, 2018
    Messages:
    33
    Likes Received:
    0
    Code (Text):
    1. command /warps:
    2.     trigger:
    3.         open virtual chest with 1 rows named "&a&lWarps" to player
    4.         format gui slot 1 of player with Grass block named "&aEurope" to run:
    5.             set {_waited} to difference between {cake.%player%.lastused} and now
    6.             if {_waited} is less than 30 minutes:
    7.                 send "&ePlease wait %difference between a minute and {_waited}% to use /warps again"
    8.             else:
    9.                 send "&aStand still for 3 seconds to be teleported to Europe"
    10.                 close player's inventory
    11.                 set {_x} to x-coords of player
    12.                 set {_z} to z-coords of player
    13.                 wait 3 seconds
    14.                 set {_x-now} to x-coords of player
    15.                 set {_z-now} to z-coords of player
    16.                 if {_x-now} = {_x}:
    17.                     if {_z-now} = {_z}:
    18.                         send "&aYou have successfully been teleported to Europe"
    19.                         teleport player to location 3752, 123, -10560 in world "GCEarth"
    20.                         set {cake.%player%.lastused} to now
    21.                     else:
    22.                         send "&cCould not teleport you to Europe" to player
    23.                         stop
     
Thread Status:
Not open for further replies.

Share This Page

Loading...