how do i skip a certain weapon in this selection scroll wheel script when the weapon has no more ammo for it?
if event.is_action_pressed("mouseDOWN") && canswitchweapon:
if !inventoryOpen:
open_Inventory()
hideweapon()
inventoryOpen = true
var now = Time.get_unix_time_from_system()
if (now > nextselect) :
var lastindex = weaponIndex
nextselect = now + .1
weaponIndex += 1
if weaponIndex > weapons.size()-1:
weaponIndex = 0
var asp = AudioStreamPlayer.new()
self.add_child(asp)
asp.stream = hideweaponSound
asp.play()
if !asp.is_playing():
asp.queue_free()
weaponInventory.get_child(weaponIndex).modulate = selectColor
weaponInventory.get_child(lastindex).modulate = normalColor
currentWeapon = weaponIndex
#hidecurrentweapon
if event.is_action_pressed("mouseUP") && canswitchweapon:
if !inventoryOpen:
open_Inventory()
hideweapon()
inventoryOpen = true
var now = Time.get_unix_time_from_system()
if (now > nextselect) :
var lastindex = weaponIndex
nextselect = now + .1
weaponIndex -= 1
if weaponIndex < 0:
weaponIndex = weapons.size()-1
var asp = AudioStreamPlayer.new()
self.add_child(asp)
asp.stream = hideweaponSound
asp.play()
if !asp.is_playing():
asp.queue_free()
weaponInventory.get_child(weaponIndex).modulate = selectColor
weaponInventory.get_child(lastindex).modulate = normalColor
currentWeapon = weaponIndex