1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Hitting my self with the "shoot arrow" skript

Discussion in 'Skript' started by Davi3684, Dec 29, 2017.

Thread Status:
Not open for further replies.
  1. Davi3684

    Davi3684 Member

    Joined:
    Dec 29, 2017
    Messages:
    15
    Likes Received:
    0
    Minecraft Version:1.8
    ---
    Full Code:

    Code (Skript):
    1.  
    2.  
    3. on join:
    4.     if {bc.rifle.%player%} is not set:
    5.         set {bc.rifle.%player%} to 0
    6.        
    7.     if {bc.pistol.%player%} is not set:
    8.         set {bc.pistol.%player%} to 0
    9.        
    10. command /getweapons:
    11.     trigger:
    12.        
    13.         if {bc.rifle.%player%} is 0:    # Rifles
    14.             set {bc.r0.ammo.%player%} to 16
    15.             set {bc.r0.leftammo.%player%} to 64
    16.             set {no.ammo.r0.%player%} to 0
    17.             give a wooden pickaxe named "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%" to the player
    18.            
    19.         if {bc.pistol.%player%} is 0:    # Pistols
    20.             set {bc.p0.ammo.%player%} to 8
    21.             set {bc.p0.leftammo.%player%} to 64
    22.             set {no.ammo.p0.%player%} to 0
    23.             give a wooden shovel named "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%" to the player
    24.            
    25.            
    26.         set {reloading.%player%} to 0
    27.            
    28.      
    29.            
    30. on left click:
    31.     if player is holding a wooden pickaxe named "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%":
    32.         if {no.ammo.r0.%player%} is 0:
    33.             shoot arrow from player's head at speed 5
    34.             set {bc.type.%last shot arrow%} to 1
    35.        
    36.        
    37.  
    38.             set {bc.r0.ammo.%player%} to {bc.r0.ammo.%player%} - 1
    39.             set the name of the player's tool to "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%"
    40.            
    41.             if {bc.r0.ammo.%player%} is 0:
    42.                 if {bc.r0.leftammo.%player%} is 0:
    43.                     set {no.ammo.r0.%player%} to 1
    44.                     set {reloading.%player%} to 0
    45.                 else:
    46.                     set {reloading.%player%} to true
    47.                     message "Reloading"
    48.                     set the name of the player's tool to "Reloading..."
    49.                     wait 20 ticks
    50.                     set the name of the player's tool to "Reloading.."
    51.                     wait 20 ticks
    52.                     set the name of the player's tool to "Reloading."
    53.                     wait 20 ticks
    54.                     set {bc.r0.leftammo.%player%} to {bc.r0.leftammo.%player%} - 16
    55.                     set {bc.r0.ammo.%player%} to 16
    56.                     set the name of the player's tool to "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%"
    57.                     set {reloading.%player%} to 0
    58.            
    59.             wait 8 ticks
    60.         else:
    61.             message "Out of ammo"
    62.            
    63.  
    64.            
    65.     if player is holding a wooden shovel named "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%":
    66.         if {no.ammo.p0.%player%} is 0:
    67.             shoot arrow from player's head at speed 3
    68.             set {bc.type.%last shot arrow%} to 1.5
    69.        
    70.        
    71.  
    72.             set {bc.p0.ammo.%player%} to {bc.p0.ammo.%player%} - 1
    73.             set the name of the player's tool to "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%"
    74.            
    75.             if {bc.p0.ammo.%player%} is 0:
    76.                 if {bc.p0.leftammo.%player%} is 0:
    77.                     set {no.ammo.p0.%player%} to 1
    78.                     set {reloading.%player%} to 0
    79.                 else:
    80.                     set {reloading.%player%} to true
    81.                     message "Reloading"
    82.                     set the name of the player's tool to "Reloading..."
    83.                     wait 20 ticks
    84.                     set the name of the player's tool to "Reloading.."
    85.                     wait 20 ticks
    86.                     set the name of the player's tool to "Reloading."
    87.                     wait 20 ticks
    88.                     set {bc.p0.leftammo.%player%} to {bc.p0.leftammo.%player%} - 8
    89.                     set {bc.p0.ammo.%player%} to 8
    90.                     set the name of the player's tool to "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%"
    91.                     set {reloading.%player%} to 0
    92.            
    93.             wait 50 ticks
    94.         else:
    95.             message "Out of ammo"
    96.            
    97.  
    98. on damage:
    99.    
    100.     projectile is a arrow
    101.     if {bc.type.%projectile%} is a number:
    102.         set damage to {bc.type.%projectile%}
    103.        
    104. on tool change:
    105.     if {reloading.%player%} is true:
    106.         cancel event
    107.        
    108.  
    So, when I use the "shoot arrow from player's head" it hits me. and I'm looking for a way to make it spawn 1 block in front of the player, but everything I try doesn't seem to work.

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
     
  2. White

    White Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    445
    Likes Received:
    25
    Try just using
    Code (Skript):
    1. shoot arrow from player at speed 2
     
Thread Status:
Not open for further replies.

Share This Page

Loading...