Throwing Nether Stars and dealing dmg

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
22
Q: How do I get it to when you right click an item aka a nether star, you shoot a nether star and if it hits a player it deals dmg.

Code:
code_language.skript:
on rightclick with nether star:
    name of player's tool is "&eShurkien &7(Right Click)":
        set {_loc} to location above player's head
        spawn falling block of nether star at {_loc}
        play "ARROW_HIT" to player at volume 1
        push last spawned entity in direction of player at speed 1
 
code_language.skript:
on rightclick with nether star:
    name of player's tool is "&eShurkien &7(Right Click)":
        set {_loc} to location above player's head
        drop 1 nether star at {_loc}
        push last dropped entity in direction of player at speed 1
        play "ARROW_HIT" to player at volume 1
 
To make it deal damage, you have to use while loop. Check if there is no block in front of the pushed item and also deal damage if there is a player right next to it.
 
code_language.skript:
on rightclick with nether star:
    name of player's tool is "&eShurkien &7(Right Click)":
        set {_loc} to location above player's head
        drop 1 nether star at {_loc}
        push last dropped entity in direction of player at speed 1
        play "ARROW_HIT" to player at volume 1
code_language.skript:
on rightclick with nether star:
    name of player's tool is "&eShurkien &7(Right Click)":
        set {_loc} to location above player's head
        drop 1 nether star at {_loc}
        push last dropped entity in direction of player at speed 1
        play "ARROW_HIT" to player at volume 1
can you send me a link to get particle effec and sounds effec>?
 
Check the code of my Throwable Axe resource.
While loop > regular loop when in a situation like item projectiles. Let's say I'm 50 blocks high and I throw my axe down to a player 50 blocks below me. If the axe hits the player, nothing works because the loop finished before it reached 50 blocks downwards. On the other hand, while loops go on forever (if you don't make a checker to stop at some point) until a condition is met (hitting ground/hitting alive entity).
 
While loop > regular loop when in a situation like item projectiles. Let's say I'm 50 blocks high and I throw my axe down to a player 50 blocks below me. If the axe hits the player, nothing works because the loop finished before it reached 50 blocks downwards. On the other hand, while loops go on forever (if you don't make a checker to stop at some point) until a condition is met (hitting ground/hitting alive entity).

I have done the loop based on the distance/push around how it works.
It will do always damage when it need to.
 
This expression/condition is giving the errors:
CODE:
code_language.skript:
        push last dropped entity in direction of player at speed 1
 
[15:34:24 ERROR]: Can't understand this condition/effect: push last dropped item in direction of player at speed 1 (Kits.sk, line 333: push last dropped item in direction of player at speed 1')
[15:34:24 INFO]: [Skript] Encountered 1 error while reloading Kits.sk!
 
try to avoid it doing:
code_language.skript:
set {_item} to last dropped item
push {_item} in direction of player at speed 2
 
[15:40:04 INFO]: [Skript] Reloading Kits.sk...
[15:40:08 ERROR]: Can't understand this expression: 'last dropped item' (Kits.sk, line 333: set {_item} to last dropped item')
[15:40:09 INFO]: [Skript] Encountered 1 error while reloading Kits.sk
 
[15:40:04 INFO]: [Skript] Reloading Kits.sk...
[15:40:08 ERROR]: Can't understand this expression: 'last dropped item' (Kits.sk, line 333: set {_item} to last dropped item')
[15:40:09 INFO]: [Skript] Encountered 1 error while reloading Kits.sk

Can you please re-post your code.
 
code_language.skript:
on rightclick with nether star:
    name of player's tool is "&eShurkien &7(Right Click)":
        set {_loc} to location above player's head
        drop 1 nether star at {_loc}
        set {_item} to last dropped item
        push {_item} in direction of player at speed 2
        play "ARROW_HIT" to player at volume 1
 
Status
Not open for further replies.