Minecraft Version:1.8
---
Full Code:
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
---
Full Code:
code_language.skript:
on join:
if {bc.rifle.%player%} is not set:
set {bc.rifle.%player%} to 0
if {bc.pistol.%player%} is not set:
set {bc.pistol.%player%} to 0
command /getweapons:
trigger:
if {bc.rifle.%player%} is 0: # Rifles
set {bc.r0.ammo.%player%} to 16
set {bc.r0.leftammo.%player%} to 64
set {no.ammo.r0.%player%} to 0
give a wooden pickaxe named "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%" to the player
if {bc.pistol.%player%} is 0: # Pistols
set {bc.p0.ammo.%player%} to 8
set {bc.p0.leftammo.%player%} to 64
set {no.ammo.p0.%player%} to 0
give a wooden shovel named "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%" to the player
set {reloading.%player%} to 0
on left click:
if player is holding a wooden pickaxe named "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%":
if {no.ammo.r0.%player%} is 0:
shoot arrow from player's head at speed 5
set {bc.type.%last shot arrow%} to 1
set {bc.r0.ammo.%player%} to {bc.r0.ammo.%player%} - 1
set the name of the player's tool to "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%"
if {bc.r0.ammo.%player%} is 0:
if {bc.r0.leftammo.%player%} is 0:
set {no.ammo.r0.%player%} to 1
set {reloading.%player%} to 0
else:
set {reloading.%player%} to true
message "Reloading"
set the name of the player's tool to "Reloading..."
wait 20 ticks
set the name of the player's tool to "Reloading.."
wait 20 ticks
set the name of the player's tool to "Reloading."
wait 20 ticks
set {bc.r0.leftammo.%player%} to {bc.r0.leftammo.%player%} - 16
set {bc.r0.ammo.%player%} to 16
set the name of the player's tool to "Rifle %{bc.r0.ammo.%player%}%/%{bc.r0.leftammo.%player%}%"
set {reloading.%player%} to 0
wait 8 ticks
else:
message "Out of ammo"
if player is holding a wooden shovel named "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%":
if {no.ammo.p0.%player%} is 0:
shoot arrow from player's head at speed 3
set {bc.type.%last shot arrow%} to 1.5
set {bc.p0.ammo.%player%} to {bc.p0.ammo.%player%} - 1
set the name of the player's tool to "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%"
if {bc.p0.ammo.%player%} is 0:
if {bc.p0.leftammo.%player%} is 0:
set {no.ammo.p0.%player%} to 1
set {reloading.%player%} to 0
else:
set {reloading.%player%} to true
message "Reloading"
set the name of the player's tool to "Reloading..."
wait 20 ticks
set the name of the player's tool to "Reloading.."
wait 20 ticks
set the name of the player's tool to "Reloading."
wait 20 ticks
set {bc.p0.leftammo.%player%} to {bc.p0.leftammo.%player%} - 8
set {bc.p0.ammo.%player%} to 8
set the name of the player's tool to "Pistol %{bc.p0.ammo.%player%}%/%{bc.p0.leftammo.%player%}%"
set {reloading.%player%} to 0
wait 50 ticks
else:
message "Out of ammo"
on damage:
projectile is a arrow
if {bc.type.%projectile%} is a number:
set damage to {bc.type.%projectile%}
on tool change:
if {reloading.%player%} is true:
cancel event
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