Solved Shooting multiple arrows with a spread (Similar to a shotgun's spread)

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

Vexio

Active Member
Jan 26, 2017
92
10
8
23
California
I'm currently attempting to re-create a Shotgun type of spread. Hopefully most people are familiar with Shotgun spreads.

GfJ-GRT_TrqsFjPKp0_pVg.png

The black + is where my Cross-hair is located. I've tried messing with the directions expression with my script, but I can't figure out how to solve this.

Code:

code_language.skript:
        else if "%name of bow%" = "&cSPAS-12":
            cancel event
            if event-player's inventory contains arrow with name "&712 Gauge":
                broadcast "&7Arrow Speed &f%arrow speed%"
                set {_arrowSpeed} to arrow speed * 1.5
                broadcast "&7New Arrow Speed &a%{_arrowSpeed}%"
                remove 1 arrow named "&712 Gauge" from event-player's inventory
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters to the right
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters above
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters to the left
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters below
                # the `0.5 meters` spawn the arrows but going towards the direction they are set to
                playSound("random.break", 0, "%event-player%")

Thanks for your help!
 
I'm currently attempting to re-create a Shotgun type of spread. Hopefully most people are familiar with Shotgun spreads.

GfJ-GRT_TrqsFjPKp0_pVg.png

The black + is where my Cross-hair is located. I've tried messing with the directions expression with my script, but I can't figure out how to solve this.

Code:

code_language.skript:
        else if "%name of bow%" = "&cSPAS-12":
            cancel event
            if event-player's inventory contains arrow with name "&712 Gauge":
                broadcast "&7Arrow Speed &f%arrow speed%"
                set {_arrowSpeed} to arrow speed * 1.5
                broadcast "&7New Arrow Speed &a%{_arrowSpeed}%"
                remove 1 arrow named "&712 Gauge" from event-player's inventory
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters to the right
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters above
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters to the left
                make the player shoot an arrow at velocity {_arrowSpeed} #0.5 meters below
                # the `0.5 meters` spawn the arrows but going towards the direction they are set to
                playSound("random.break", 0, "%event-player%")

Thanks for your help!
Just slightly push the last shot projectile in various directions
 
Just slightly push the last shot projectile in various directions
Doesn't seem like that's working. Unless I formatted the direction expression incorrectly. or just in general...
Code:

code_language.skript:
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile right at speed 5
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile left at speed 5
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile upwards at speed 5
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile downwards at speed 5
 
Doesn't seem like that's working. Unless I formatted the direction expression incorrectly. or just in general...
Code:

code_language.skript:
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile right at speed 5
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile left at speed 5
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile upwards at speed 5
                make the player shoot an arrow at velocity {_arrowSpeed}
                push the projectile downwards at speed 5
The correct syntax is last shot projectile
 
Status
Not open for further replies.