Gun

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

Ranik_

Member
Aug 29, 2021
4
0
1
Hello!
I want to create a gun for my server and I want to use black head-like with armor stands as a projectile that it shoots and does damage and explodes if hits an entity or a block with a cooldown. I tried doing it with wither skulls but wither skulls doesn't work well. here is the wither skull skript.
Code:
on right click with netherite hoe:
    if name of player's held item is "&0&lBlack Quartz Scythe":
        set {Black Quartz Scythe.bullets.%player%} to 1
        shoot wither skull from the player at speed 1
        push last shot wither skull upwards with speed 0.06
on damage:
    if event-projectile is wither skull:
        {Black Quartz Scythe.bullets.%shooter%} is 1:
            damage victim by 8
on projectile hit:
    wait 3 ticks
    if event-projectile is an wither skull:
        create a safe explosion of force 3 at event-location
 
Code:
on rightclick:
 if player's held item is a golden hoe:
  if {ghoeammo.%uuid of player%} is greater than 0:
   shoot a snowball from player 
   subtract 1 from {ghoeammo.%uuid of player%}
  else if {ghoeammo.%uuid of player%} = 0:
   send "&e&lAmmo: &7You don't have enough &eAmmo!"

on rightclick:
    if player's held item is gunpowder:
        if {ghoeammo.%uuid of player%} < 30:
            add 1 to {ghoeammo.%uuid of player%}
            remove 1 gunpowder from player's inventory
        else if {ghoeammo.%uuid of player%} is equal to 30:
            send "&e&lAmmo: &7You got max ammo!"
  

every second in "world":
 loop all players:
  if loop-player's held item is a golden hoe:
   send action bar "&eAmmo: &f%{ghoeammo.%uuid of loop-player%}%&e/&f30" to loop-player
   
on damage:
 if projectile is a snowball:
  damage  the victim by 2 hearts
 
Status
Not open for further replies.