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.

Hyperion from hypixel skyblock

Discussion in 'Requests' started by Shire104, Jun 28, 2021.

  1. Shire104

    Shire104 Member

    Joined:
    Jun 21, 2021
    Messages:
    1
    Likes Received:
    0
    Suggested name: Hyperion

    Spigot/Skript Version: 1.16.5

    What I want:
    A hyperion from hypixel skyblock aka an iron sword named "&6Hyperion" that on right click, you will teleport yourself 8 blocks in your direction and safe explode after teleporting

    When I'd like it by: asap
     
  2. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    This may be what you are looking for...
    Spawn it in with /hyperion
    Code (Text):
    1. command /hyperion:
    2.     description: Give the player Hyperion!
    3.     trigger:
    4.         set {_lore::*} to " " and "&6&LLEGENDARY DUNGEON SWORD"
    5.         give player 1 iron sword named "&6Hyperion" with lore {_lore::*}
    6.         send "&7You have acquired &6Hyperion&7!"
    7.  
    8. on join:
    9.   set {%player%.hyperion} to 0
    10.  
    11. on right click:
    12.     if player's held item is iron sword named "&6Hyperion":
    13.         if {%player%.hyperion} is 0:
    14.             push player forward at speed 1.6
    15.             push player up at speed 0.2
    16.             set {%player%.hyperion} to 1
    17.             wait 3 seconds
    18.             set {%player%.hyperion} to 0
    19.         else:
    20.             send "&7This is on cooldown!"
    21.  
     
  3. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    This code is very inefficient and not exactly what he wanted, I tried it myself but failed at the teleport thing.
    I beg you to:
    - stop making such cooldown
    - starting a variable with %player%
    - not using list variables

    And why are you using a variable to set the lore?
     
  4. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    Yeah sorry, I've been away from Skript for over a year now and just decided to get back into it but remembering the syntaxes is hard. Anyways my memory has refreshed a bit so here is a better version (With the explosion too!)

    **EDIT: Some of Skripts syntaxes didn't seem to want to work, hence the extended code for determining a players direction. If anyone has a WORKING way of getting the direction a player is facing, please lmk.

    Code (Text):
    1.  
    2. command /hyperion:
    3.     description: Give the player Hyperion!
    4.     trigger:
    5.         give player 1 iron sword named "&6Hyperion" with lore " " and "&6&LLEGENDARY DUNGEON SWORD"
    6.         send "&7You have acquired &6Hyperion&7!"
    7.         set {hyperion.%player%} to 0
    8.  
    9. on right click with iron sword:
    10.     if player's held item is iron sword named "&6Hyperion":
    11.         if {hyperion.%player%} is 0:
    12.             if player's yaw is between 45 and 135: #west
    13.                 set {_loc} to the location 8 meters west of the player
    14.             if player's yaw is between 136 and 225: #north
    15.                 set {_loc} to the location 8 meters north of the player
    16.             if player's yaw is between 226 and 315: #east
    17.                 set {_loc} to the location 8 meters east of the player
    18.             if player's yaw is greater than 315:
    19.                 set {_loc} to the location 8 meters south of the player
    20.             if player's yaw is less than 45:
    21.                 set {_loc} to the location 8 meters south of the player
    22.             teleport player to {_loc}
    23.             create a fake explosion 1 meter above the player
    24.             push player up at speed .5
    25.             set {hyperion.%player%} to 1
    26.             wait 1 seconds
    27.             set {hyperion.%player%} to 0
    28.         else:
    29.             send "&7This is on cooldown!"
    30.  
    --- Double Post Merged, Jul 3, 2021, Original Post Date: Jul 3, 2021 ---
    "- stop making such cooldown"
    - The cooldown was because the sword could easily be spammed, optimized it in the newer skript. Again I'm starting kinda fresh so this was for of a refreshing exercise

    "- starting a variable with %player%"
    - YOU ARE SO RIGHT. NEVER START A VARIABLE WITH %PLAYER%!!!!!!! HOW COULD I FORGET

    "- not using list variables"
    - Why would I use a list variable? Would you mean something like this: {hyperion::%player%}
    (If this is the case is this more efficient to store them this way? If so can you explain it, or link to somewhere that does?)
     
  5. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    "- stop making such cooldown"
    Don't create cooldowns using e.g. "wait 1 second", when the server crashes or stops unexpected the cooldown is ruined and has to be restored via another event. The better solution would be:
    Code (Text):
    1. event xyz:
    2.     if difference between now and {cooldownvar::%player%} is more than 12 seconds:
    3.         send "ok"
    4.         set {cooldownvar::%player%} to now
    "- starting a variable with %player%"
    This seems a bit ironic to me... but I don't know where you learned that, in every skript tutorial I found in 5min there is no tutorial that advises you to start a variable with %player%.

    "- not using list variables"
    In this case, it may be okay because the cooldown is not that huge. If the cooldown was more than maybe an hour, It's important to. E.g. you want to reset the cooldown of all players because of a vote event or something: so you can just reset it using delete {cooldownvar::*}, this event is a bad example, but list variables are much cleaner and efficient when using.
     

Share This Page

Loading...