Help with making a "minigun"

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

SquidR

New Member
Jan 28, 2021
6
0
1
19
So my code is as follows

on right click with bow:
execute console command "execute as @p at @p run summon arrow ~ ~ ~ {Motion:[1.0,0.0,0.0]}":

I'm trying to make it fire in a direction, but when i try to run it, it shows as an error but there is no error without the motion nbt tag.
 
simple code, the tool needs to be a diamond hoe and named Machine Gun.
Code:
on right click:
    if player's tool is diamond hoe:
        if uncolored name of player's tool is "Machine Gun":
            cancel event
            loop 2 times:
                shoot an arrow at speed 0.9
                push the player backwards at velocity 0.03
                wait a tick
                shoot an arrow at speed 0.9
                wait a tick
                shoot an arrow at speed 0.9
 
simple code, the tool needs to be a diamond hoe and named Machine Gun.
Code:
on right click:
    if player's tool is diamond hoe:
        if uncolored name of player's tool is "Machine Gun":
            cancel event
            loop 2 times:
                shoot an arrow at speed 0.9
                push the player backwards at velocity 0.03
                wait a tick
                shoot an arrow at speed 0.9
                wait a tick
                shoot an arrow at speed 0.9
thank you!
 
thank you!
mark issue as solved

also i made a GUN script so here u go
Code:
command /weapon [<text>] [<player>]:
  permission: manager
  trigger:
    if arg-2 is not set:
      send "/weapon <weapon type or list> <player>"
      
    if arg-2 is set:
      if arg-1 is "list":
        send "1) AK-47"
        SEND "2) Bazooka"
      if arg-1 is "ak47":
        give arg-2 stick named "&cAK-47" with lore "&7Right click from a distance at a player.%newline%&7you're gonna be there soon :]"
        send "&aGave &f%arg-2% &aan AK-47." to player
      if arg-1 is "bazooka":
        give arg-2 diamond shovel named "&2&lBAZOOKA" with lore "&7Right click from a distance at a player.%newline%&7but it's &2&lBOOM BOOM&7..."
        send "&aGave &f%arg-2% &aa Bazooka." to player
      
on damage:
  projectile is a snowball
  attacker is holding a stick named "&cAK-47" with lore "&7Right click from a distance at a player.%newline%&7you're gonna be there soon :]":
    damage victim by 2 hearts
    
on projectile hit:
  projectile is an egg
  shooter is holding a diamond shovel named "&2&lBAZOOKA" with lore "&7Right click from a distance at a player.%newline%&7but it's &2&lBOOM BOOM&7...":
    shooter is in world "eventshub" or "allevents" or "build" or "parkours":
      send "&cBuddy not today. Be in another world not the %shooter's world% &cworld..." to shooter
    else:
      loop all living entities in radius 10 around projectile:
        damage loop-entity by 9 hearts
      create an explosion of force 10 at projectile
      set {air} to air
      loop all blocks in radius 5 around projectile:
        loop-block is not bedrock:
          set loop-block to {air}
 
    
on right click:
  player is holding a stick named "&cAK-47" with lore "&7Right click from a distance at a player.%newline%&7you're gonna be there soon :]":
    if {ammoak47.%player%} is greater or equal to 20:
      send "&aWeapon needs a reload! Left click to reload!"
    else:
      shoot a snowball from player at speed 5
      add 1 to {ammoak47.%player%}
      
on left click:
  player is holding a stick named "&cAK-47" with lore "&7Right click from a distance at a player.%newline%&7you're gonna be there soon :]":
    if {reloading.%player%} is true:
      send "&cYou're already reloading muffin head...."
    else:
      set {reloading.%player%} to true
      send "&aReloading."
      wait 15 ticks
      send "&aReloading.."
      wait 15 ticks
      send "&aReloading..."
      wait 15 ticks
      clear {ammoak47.%player%}
      send "&aReload succeeded! You may now shoot."
      set {reloading.%player%} to false
 
    
on rightclick:
  player is holding a diamond shovel named "&2&lBAZOOKA" with lore "&7Right click from a distance at a player.%newline%&7but it's &2&lBOOM BOOM&7...":
    set {baz} to difference between {baz.%player%} and now
    if {baz} is less than 5 seconds:
      send "&aReloading..."
      stop
    set {baz.%player%} to now
    shoot an egg from player at speed 0.9

it has bazooka and ak47 and it can reload. every 20 bullets ak will reload and every 1 bullet bazooka will reload.
left click to reload. bazooka automatically reloads
 
Status
Not open for further replies.