Solved Need help with despawning arrow...

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

Aryaz25

Member
Apr 6, 2017
23
0
1
31
Hello! I'm working on a skript that makes a bow doesn't require any arrow. well everything works pretty well until the despawning the arrow part. Here's the code that im working:

code_language.skript:
on right click:
    if player's tool is bow:
        if {shoot.%player%} is set:
            cancel event
        else:
            cancel event
            shoot an arrow from player at speed 5
            set {shoot.%player%} to true
            wait 1 second

on projectile hit:
    if projectile is an arrow:
        kill last spawned arrow

This code is not working. but there's no error when I load the skript. I did research the documentations, search the forum, and try on different way like loop the entity or set the entity to a variable. but none of them worked. Also I tried to change the type to all arrows and all projectiles. And none of them worked.

I dont know what to do anymore and decided to ask in the forum. I hope someone will try to help me.

Thanks!

Bump?
[doublepost=1493891791,1492261363][/doublepost]Bump
 
fixed code:

code_language.skript:
on right click:
    if player's tool is bow:
        cancel event
        if {shoot.%player%} isn't set:
            shoot an arrow from player at speed 5
            set {shoot.%player%} to true
            wait 1 second
 
on projectile hit:
    if projectile is an arrow:
        kill projectile
 
Last edited by a moderator:
  • on right click:
  • if player's tool is bow:
  • cancel event
  • if {shoot.%player%} isn't set:
  • shoot an arrow from player at speed 5
  • set {shoot.%player%} to true
  • wait 1 second
  • on projectile hit:
  • if projectile is an arrow:
  • kill projectile

Not working for me :/ maybe because of my bukkit ver i guess? anyway thanks for helping

This just doesn't make sense to me.
Why cancel the event twice?

Lmao this code is an old code. I should rewrite the code
 
Hey Im pretty sorry but that line of code doesn't work for me...
Im on 1.8, that code doesnt send any errors, but arrows dont despawn
 
Status
Not open for further replies.