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!

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

Solved can someone please add a 3 second cooldown?

Discussion in 'Requests' started by HypixelsFox, Jul 8, 2021.

  1. HypixelsFox

    HypixelsFox Member

    Joined:
    Mar 26, 2021
    Messages:
    14
    Likes Received:
    1
    hello so im working on a wand skript and i've been having issues with my current cooldown script because it basically cancels everything so i would love a new one.

    command /wand:
    ----trigger:
    ------player has permission "skript.Wand"
    ------give blaze rod named "&c&lWand" with lore "&kL<reset>" to player

    on right click:
    --if name of item is "&c&lWand":
    ----if {%player%.spellselected} is "fireball":
    ------set {%player%.spellselected} to "thunderbolt"
    ------send action bar "&aSpell: &bthunderbolt" to player
    ----else if {%player%.spellselected} is "thunderbolt":
    ------set {%player%.spellselected} to "spark"
    ------send action bar "&aSpell: &5spark" to player
    ----else if {%player%.spellselected} is "spark":
    ------set {%player%.spellselected} to "heal"
    ------send action bar "&aSpell: &2heal" to player
    ----else if {%player%.spellselected} is "heal":
    ------set {%player%.spellselected} to "fireball"
    ------send action bar "&aSpell: &cfireball" to player

    on left click:
    --if name of item is "&c&lWand":
    ----cancel event
    ----if {%player%.spellselected} is "fireball":
    ------spawn fireball at location 1 meter above and 2 meters in front of player
    ------add "{ExplosionPower:2}" to nbt of last spawned entity
    ------push last spawned entity in direction of player with force 1
    ----else if {%player%.spellselected} is "thunderbolt":
    ------if target of player is an entity:
    --------strike lightning at target entity
    --------drawDot count 5, particle "cloud", XYZ 0, 0, 0, center {_loc}, visibleRange 32, pulseDelay 0, keepFor 10 ticks
    ------else:
    --------stop
    ----else if {%player%.spellselected} is "spark":
    ------if target of player is an entity:
    --------damage target by 2
    --------set {_loc} to the location 1 meter above target
    --------drawSphere style 2, particle "redstone", speed 10, RGB 235, 52, 52, center {_loc}, id "%player%.sphere", rainbowMode false, radius 1, density 5, visibleRange 32, pulseDelay 0
    --------drawSphere style 2, particle "redstone", speed 10, RGB 255, 0, 153, center {_loc}, id "%player%.sphere2", rainbowMode false, radius 1, density 5, visibleRange 32, pulseDelay 0
    --------drawSphere style 2, particle "redstone", speed 10, RGB 255, 0, 200, center {_loc}, id "%player%.sphere3", rainbowMode false, radius 1, density 5, visibleRange 32, pulseDelay 0
    --------wait 0.5 seconds
    --------stopEffect "%player%.sphere"
    --------stopEffect "%player%.sphere2"
    --------stopEffect "%player%.sphere3"
    ------else:
    --------stop
    ----else if {%player%.spellselected} is "heal":
    ------add 3 to player's health

    command sendhelp:
    ----trigger:
    --------send "help arrived!"
    --------set {%player%.spellselected} to "fireball"

     
  2. Best Answer:
    Post #4 by AHappyLittleSloth, Jul 8, 2021
  3. ImOfflinezzz

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    73
    Likes Received:
    10
    You have no value for {%player%.spellselected}

    Code (Text):
    1.  
    2. Replace
    3.  else if {%player%.spellselected} is "heal":
    4.  
    5. with simple
    6.  else:
    7.  
     
  4. HypixelsFox

    HypixelsFox Member

    Joined:
    Mar 26, 2021
    Messages:
    14
    Likes Received:
    1
    i tried replacing the else if with else and it showed alot of errors and the entire wand broke
     
  5. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    First off, CODE BLOCKS PLEASE
    Also use this:
    Code (Text):
    1. command /wand:
    2.   trigger:
    3.     player has permission "skript.Wand"
    4.     give blaze rod named "&c&lWand" with lore "&kL<reset>" to player
    5.  
    6. on right click:
    7.   if name of item is "&c&lWand":
    8.     if {%player%.spellselected} is "fireball":
    9.       set {%player%.spellselected} to "thunderbolt"
    10.       send action bar "&aSpell: &bthunderbolt" to player
    11.     else if {%player%.spellselected} is "thunderbolt":
    12.       set {%player%.spellselected} to "spark"
    13.       send action bar "&aSpell: &5spark" to player
    14.     else if {%player%.spellselected} is "spark":
    15.       set {%player%.spellselected} to "heal"
    16.       send action bar "&aSpell: &2heal" to player
    17.     else if {%player%.spellselected} is "heal":
    18.       set {%player%.spellselected} to "fireball"
    19.       send action bar "&aSpell: &cfireball" to player
    20.     else:
    21.       set {%player%.spellselected} to "thunderbolt"
    22.       send action bar "&aSpell: &bthunderbolt" to player
    23.  
    24.  
    25. on left click:
    26.   if name of item is "&c&lWand":
    27.     cancel event
    28.     if {%player%.spellselected} is "fireball":
    29.       spawn fireball at location 1 meter above and 2 meters in front of player
    30.       add "{ExplosionPower:2}" to nbt of last spawned entity
    31.       push last spawned entity in direction of player with force 1
    32.     else if {%player%.spellselected} is "thunderbolt":
    33.       if target of player is an entity:
    34.         strike lightning at target entity
    35.         drawDot count 5, particle "cloud", XYZ 0, 0, 0, center {_loc}, visibleRange 32, pulseDelay 0, keepFor 10 ticks
    36.       else:
    37.         stop
    38.     else if {%player%.spellselected} is "spark":
    39.       if target of player is an entity:
    40.         damage target by 2
    41.         set {_loc} to the location 1 meter above target
    42.         drawSphere style 2, particle "redstone", speed 10, RGB 235, 52, 52, center {_loc}, id "%player%.sphere", rainbowMode false, radius 1, density 5, visibleRange 32, pulseDelay 0
    43.         drawSphere style 2, particle "redstone", speed 10, RGB 255, 0, 153, center {_loc}, id "%player%.sphere2", rainbowMode false, radius 1, density 5, visibleRange 32, pulseDelay 0
    44.         drawSphere style 2, particle "redstone", speed 10, RGB 255, 0, 200, center {_loc}, id "%player%.sphere3", rainbowMode false, radius 1, density 5, visibleRange 32, pulseDelay 0
    45.         wait 0.5 seconds
    46.         stopEffect "%player%.sphere"
    47.         stopEffect "%player%.sphere2"
    48.         stopEffect "%player%.sphere3"
    49.       else:
    50.         stop
    51.     else if {%player%.spellselected} is "heal":
    52.       add 3 to player's health
    53.  
    54. command sendhelp:
    55.   trigger:
    56.     send "help arrived!"
    57.     set {%player%.spellselected} to "fireball"
    58.  
     

Share This Page

Loading...