Multiple Shot Bow

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

    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.

ChocoAura

Member
Jul 3, 2019
38
0
6
I want to make a bow that shoots 3 arrows, the original one, then another after 3 ticks, then the third after another 3 ticks.

I'm not sure how to do this, could someone help me?
 
https://forums.skunity.com/threads/shoot-item.3610/
I found something relevant.
(I’m on phone)
[doublepost=1564131302,1564131093][/doublepost]If you dont know write skript,

Code:
on shoot:
    tool of shooter is bow
    loop 3 times:
        shooter has a arrow
        make shooter shoot a arrow
        wait a tick
Not tested but I think should work

You could do that but put in a line to detect for a name so only a bow with a certain name can do that. Example:
Code:
if the name of event-item is "Artemis's Bow":

So if combined with @KingAdmin_YT 's code it should look like this
Code:
on shoot:
    tool of shooter is bow
    if the name of the shooter's tool is "Artemis's Bow":
        loop 3 times:
            shooter has a arrow
            make shooter shoot a arrow
            wait a tick

Or if you wanted it to take one arrow it could be
Code:
on shoot:
    tool of shooter is bow
    if the name of the shooter's tool is "Artemis's Bow":
        shooter has an arrow
        remove arrow from shooter:
        loop 3 times:
            make shooter shoot a arrow
            wait a tick
 
Last edited:
You could do that but put in a line to detect for a name so only a bow with a certain name can do that. Example:
Code:
if the name of event-item is "Artemis's Bow":

So if combined with @KingAdmin_YT 's code it should look like this
Code:
on shoot:
    tool of shooter is bow
    if the name of the shooter's tool is "Artemis's Bow":
        loop 3 times:
            shooter has a arrow
            make shooter shoot a arrow
            wait a tick

Or if you wanted it to take one arrow it could be
Code:
on shoot:
    tool of shooter is bow
    if the name of the shooter's tool is "Artemis's Bow":
        shooter has an arrow
        remove arrow from shooter:
        loop 3 times:
            make shooter shoot a arrow
            wait a tick
So I was in creative with a stack of arrows, and it crashed the server and me.
 
So I was in creative with a stack of arrows, and it crashed the server and me.

I tested it, and i see the problem because it is shooting an arrow which causes the skript to replay causing it to shoot forever

You could make it so it is on a right click?
Code:
on right click:
    tool of player is bow
    if the name of the player's tool is "Artemis's Bow":
        shooter has an arrow
        remove arrow from shooter:
        loop 3 times:
            make player shoot a arrow
            wait a tick
 
Last edited:
So I was in creative with a stack of arrows, and it crashed the server and me.
The reason the server crashed, when the events runs so it is shooting, back to the beginning of the event then it's entering an unlimited loop.
I never thought of it. I'm sorry for this mistake.

Tried and working..
Code:
on shoot:
    shooter is player
    "%projectile%" is "arrow"
    name of tool of shooter is "My Bow"
    {nospam::%shooter%} is not set
    set {nospam::%shooter%} to true
    loop 3 times:
        shooter has an arrow
        remove arrow from shooter
        make shooter shoot a arrow
        wait a tick
    delete {nospam::%shooter%}
 
Last edited:
Status
Not open for further replies.