Jump to content

Skript gun not working


kxden

Recommended Posts

Hello! Right now im making a skript thats a reloadable gun with mags, but every time i reload it, it reloads more than one mag when the skript says to remove 1 mag. The iron nuggets are supposed to be mags, so its supposed to take one mag every time it reloads but it takes more than one.

 

variables:
    {%player%.pistol} = 0
    
on left click:
    if player is holding iron horse armor named "gun":
        cancel event
    if player does not have iron nuggets named "mag":
        message "&e&lWARNING: &cYou are out of ammo!"
        stop
    if {%player%.pistol} is not 10:
        play sound "ENTITY_ZOMBIE_ATTACK_WOODEN_DOOR" to player
        shoot snowball 
        add 1 to {%player%.pistol}
        stop
    if {%player%.pistol} is 10:
        cancel event
        send action bar "&4&lRELOADING" to player
        wait 3 seconds        
        send action bar "" to player
        set {%player%.pistol} to 0
        remove 1 iron nugget named "mag" from player 
        stop

        

        If anyone could help that would be awesome thanks 🙂

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...