Hello, i am willing to create a fully working gun system for my server, but since i dont have much experience with skript its gonna be hard for me. Thats why im here, i need help with the following stuff (Ammo System, Bullets dont work if they hit wall and gravity for bullets). Also, here is my code:
on right click:
if player's held item is white dye named "&2&lPISTOL":
if {pistol.%uuid of player%} is less than 1:
play sound "block.fire.ambient" to player
loop 200 times:
set {_loc} to location (loop-value / 5) meters in front of and 1.3 meters above the player
draw 1 of dustcolortransition using dustTransition(gray, yellow, 2) at {_loc}
set {_range} to 50
if distance between location of player and targeted entity of player < {_range}:
loop all entities in radius 1 around targeted entity:
loop-entity isn't a dropped item or projectile or the player
set loop-entity on fire for 3 seconds
damage loop-entity by 2
send action bar "&cYou just hit %loop-entity% with your ability!" to player
set {pistol.%uuid of player%} to 10
loop 10 times:
wait 1 second
remove 1 from {pistol.%uuid of player%}
else:
send "{@prefix} &aYou still need to wait &c%{pistol.%uuid of player%}%"
play sound "block.note_block.bass" to player
on join:
if {pistol.%uuid of player%} is not set:
set {pistol.%uuid of player%} to 0
on join:
set {pistol.%uuid of player%} to 0
Posted by: CompX from the skUnity Discord. View the thread on skUnity Discord here
on right click:
if player's held item is white dye named "&2&lPISTOL":
if {pistol.%uuid of player%} is less than 1:
play sound "block.fire.ambient" to player
loop 200 times:
set {_loc} to location (loop-value / 5) meters in front of and 1.3 meters above the player
draw 1 of dustcolortransition using dustTransition(gray, yellow, 2) at {_loc}
set {_range} to 50
if distance between location of player and targeted entity of player < {_range}:
loop all entities in radius 1 around targeted entity:
loop-entity isn't a dropped item or projectile or the player
set loop-entity on fire for 3 seconds
damage loop-entity by 2
send action bar "&cYou just hit %loop-entity% with your ability!" to player
set {pistol.%uuid of player%} to 10
loop 10 times:
wait 1 second
remove 1 from {pistol.%uuid of player%}
else:
send "{@prefix} &aYou still need to wait &c%{pistol.%uuid of player%}%"
play sound "block.note_block.bass" to player
on join:
if {pistol.%uuid of player%} is not set:
set {pistol.%uuid of player%} to 0
on join:
set {pistol.%uuid of player%} to 0
Posted by: CompX from the skUnity Discord. View the thread on skUnity Discord here