[Help] Gun Skript

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

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

Parqtx

Member
May 18, 2018
2
0
0
21
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
 
well, that is 1 limitation of Minecraft, that you need space to shoot a projectile, else it sometimes doesnt fire
 
Status
Not open for further replies.