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.

Need help for my custom item skript

Discussion in 'Skript' started by RedDiamond, Dec 9, 2020.

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

    RedDiamond Member

    Joined:
    Nov 30, 2020
    Messages:
    16
    Likes Received:
    0
    I really need help for this one, so I've made a custom items that do stuff with a cooldown, but when I run it on minehut it didn't want to do any of the effects and just skip to the 'else' part anyone know why?
    Code (Text):
    1. options:
    2.   prefix: &8[&a&lKrypBox&8]
    3.  
    4. variables:
    5.   {Cooldown.%player%} = 0
    6.  
    7. #Fire Wand
    8. on rightclick holding a blaze rod:
    9.   if uncolored name of player's tool is "Fire Wand":
    10.     if {Cooldown.%player%} = 0:
    11.       set {Cooldown.%player%} to 1
    12.       play sound "entity.blaze.shoot" with volume 1 to the player
    13.       make the player shoot a fireball at speed 4
    14.       wait 1.5 seconds
    15.       set {Cooldown.%player%} to 0
    16.     else if {Cooldown.%player%} = 1:
    17.       message "{@prefix} &cYou Can Only Shoot Fireball Every 1.5 Seconds!" to player
    18.  
    19. #Launcher
    20. on rightclick holding a fishing rod:
    21.   if uncolored name of player's tool is "Launcher":
    22.     if {Cooldown.%player%} = 0:
    23.       set {Cooldown.%player%} to 1
    24.       play sound "entity.slime.jump" with volume 1 to the player
    25.       push the player upwards at speed 1
    26.       push the player forwards at speed 1.5
    27.       wait 3 seconds
    28.       set {Cooldown.%player%} to 0
    29.     else if {Cooldown.%player%} = 1:
    30.       message "{@prefix} &cYou Can Only Launch Every 3 Seconds!" to player
    any help will be appreciate
     
  2. acai

    acai Active Member

    Joined:
    Oct 23, 2020
    Messages:
    89
    Likes Received:
    1
    a variable containing %player% cannot be defined in variables: section. Try setting it on join: instead, such as:
    Code (Text):
    1. on join:
    2.   set {blahclbajsiefjjsrfj_%player%} to 0
     
  3. RedDiamond

    RedDiamond Member

    Joined:
    Nov 30, 2020
    Messages:
    16
    Likes Received:
    0
    Thx this really help me, its just weird I try it on my localhost and its work, but not with minehut. anyways thx
     
Thread Status:
Not open for further replies.

Share This Page

Loading...