Hello the following gun script is working completely. Yet another player does not shoot if we are close. How can I fix it.
code_language.skript:
#==============================================================================
# Silahlar Skript
#==============================================================================
command /silah [<text>]:
trigger:
if arg 1 is not set:
send "&6Parsia &f» &7Silah almak için &a/silah AK47 , Glock , M4A1 , Deagle , AWP"
if arg 1 is "AK47":
set {ak} to red_carpet named "&6AK47"
give {ak} to the player
set {ak.zaman.%player%} to true
if arg 1 is "Glock":
set {gl} to orange_carpet named "&6Glock"
give {gl} to the player
set {gl.zaman.%player%} to true
if arg 1 is "M4A1":
set {m4} to white_carpet named "&6M4A1"
give {m4} to the player
set {m4.zaman.%player%} to true
if arg 1 is "Deagle":
set {de} to magenta_carpet named "&6Deagle"
give {de} to the player
set {de.zaman.%player%} to true
if arg 1 is "AWP":
set {aw} to cyan_carpet named "&6AWP"
give {aw} to the player
set {aw.zaman.%player%} to true
on rightclick:
player is holding {ak}:
if player has a snowball named "&6AK47 &7Kurşunu":
if {ak.zaman.%player%} is true:
play sound "block.anvil.destroy" with volume 5 and pitch 1 at players in radius 15 of player
shoot an snowball from player
set {ak.zaman.%player%} to false
remove 1 snowball named "&6AK47 &7Kurşunu" from the player
wait 0.15 seconds
set {ak.zaman.%player%} to true
else:
cancel event
else:
send "&cKurşun yok" to player
player is holding {gl}:
if player has a snowball named "&6Glock &7Kurşunu":
if {gl.zaman.%player%} is true:
play sound "block.anvil.destroy" with volume 5 and pitch 1 at players in radius 15 of player
shoot an snowball from player
set {gl.zaman.%player%} to false
remove 1 snowball named "&6Glock &7Kurşunu" from the player
wait 0.30 seconds
set {gl.zaman.%player%} to true
else:
cancel event
else:
send "{@mesaj} &cKurşun yok" to player
player is holding {m4}:
if player has a snowball named "&6M4A1 &7Kurşunu":
if {m4.zaman.%player%} is true:
play sound "block.anvil.destroy" with volume 5 and pitch 1 at players in radius 15 of player
shoot an snowball from player
set {m4.zaman.%player%} to false
remove 1 snowball named "&6M4A1 &7Kurşunu" from the player
wait 0.15 seconds
set {m4.zaman.%player%} to true
else:
cancel event
else:
send "&cKurşun yok" to player
player is holding {de}:
if player has a snowball named "&6Deagle &7Kurşunu":
if {de.zaman.%player%} is true:
play sound "block.anvil.destroy" with volume 5 and pitch 1 at players in radius 15 of player
shoot an snowball from player
set {de.zaman.%player%} to false
remove 1 snowball named "&6Deagle &7Kurşunu" from the player
wait 0.30 seconds
set {de.zaman.%player%} to true
else:
cancel event
else:
send " &cKurşun yok" to player
player is holding {aw}:
if player has a snowball named "&6AWP &7Kurşunu":
if {aw.zaman.%player%} is true:
play sound "block.anvil.destroy" with volume 5 and pitch 1 at players in radius 15 of player
shoot an snowball from player
set {aw.zaman.%player%} to false
remove 1 snowball named "&6AWP &7Kurşunu" from the player
wait 0.30 seconds
set {aw.zaman.%player%} to true
else:
cancel event
else:
send "&cKurşun yok" to player
on damage:
attacker is a player:
attacker is holding {ak}:
damage victim by 1 hearts
attacker is holding {glock}:
damage victim by 1.5 hearts
attacker is holding {m4}:
damage victim by 2 hearts
attacker is holding {de}:
damage victim by 2.5 hearts
attacker is holding {aw}:
damage victim by 5 hearts
command /mermi [<text>]:
trigger:
if arg 1 is not set:
send "&6Parsia &f» &7Mermi almak için &a/mermi AK47 , Glock , M4A1 , Deagle , AWP"
if arg 1 is "AK47":
give 16 snowball named "&6AK47 &7Kurşunu" to the player
if arg 1 is "Glock":
give 16 snowball named "&6Glock &7Kurşunu" to the player
if arg 1 is "M4A1":
give 16 snowball named "&6M4A1 &7Kurşunu" to the player
if arg 1 is "Deagle":
give 16 snowball named "&6Deagle &7Kurşunu" to the player
if arg 1 is "AWP":
give 16 snowball named "&6AWP &7Kurşunu" to the player