Solved How to make Weapons

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

Dxstin

Member
Oct 1, 2020
15
1
3
25
Hey,
how to make weapons that shoot snowballs not only forward but also to the left or right, so I can make a shotgun for example?

Thanks already for any answer!
 
Hey,
how to make weapons that shoot snowballs not only forward but also to the left or right, so I can make a shotgun for example?

Thanks already for any answer!
This is a basic code, but it does what you want.

code_language.skript:
on right click with diamond hoe:
    if name of player's held item is "&6Shotgun":
        set {shotgun.bullets.%player%} to 4
        shoot snowball from the player at speed 2
        push last shot snowball upwards with speed 0.06
        shoot snowball from the player at speed 2
        push last shot snowball downwards with speed 0.09
        shoot snowball from the player at speed 2
        push last shot snowball left with speed 0.06
        shoot snowball from the player at speed 2
        push last shot snowball right with speed 0.06
       
on damage:
    if event-projectile is snowball:
        {shotgun.bullets.%shooter%} is 4:
            damage victim by 4
 
This is a basic code, but it does what you want.

code_language.skript:
on right click with diamond hoe:
    if name of player's held item is "&6Shotgun":
        set {shotgun.bullets.%player%} to 4
        shoot snowball from the player at speed 2
        push last shot snowball upwards with speed 0.06
        shoot snowball from the player at speed 2
        push last shot snowball downwards with speed 0.09
        shoot snowball from the player at speed 2
        push last shot snowball left with speed 0.06
        shoot snowball from the player at speed 2
        push last shot snowball right with speed 0.06
      
on damage:
    if event-projectile is snowball:
        {shotgun.bullets.%shooter%} is 4:
            damage victim by 4
Thank you! It worked!
 
Status
Not open for further replies.