How to put two different functions on one mouse button ?!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mifa

Hello everyone I am new to this forum.
I’m wondering if it’s possible to put two different functions on one mouse button.
for example:
if button number 1 is a rifle with its animations and sound effects.
and if button 2 is an ax with its animations.
What they have in common is the left mouse button, when I press the number 1 button and press the left mouse button to show the animation of the rifle, and when I press the number 2 button and press the left mouse button, I get animation and ax effects.

here is my code:

extends Spatial

class_name Weapon

var add_method = preload(“res://Player/”).new()

var per = preload(“res://Player/”).new()
if Input.is_action_just_pressed(“primary_fire”):
if current_ammo > 0 and can_fire and not reloading:

		if raycast.is_colliding():
			var b = bullet.instance()
			b.look_at($"../../RayCast".get_collision_point(), Vector3.UP)
			b.shoot = true
		elif not reloading:

if Input.is_action_just_pressed("primary_fire"):

extends Spatial

var add_method = preload(“res://Player/”).new()

func _physics_process(delta):
if Input.is_action_just_pressed(“primary_fire”):“Axe_cut”)

extends KinematicBody

class_name Player_val

export var current_weapon = 0
func weapon_select():
if Input.is_action_just_pressed(“weapon1”):
current_weapon = 1

elif Input.is_action_just_pressed("weapon2"):
	current_weapon = 2
if current_weapon == 1:
	weapon1.visible = true
	weapon1.visible = false
if current_weapon == 2:
	weapon2.visible = true
	weapon2.visible = false

Occurs when I select for example button number 1 and press the left button I get two effects in one the sound of a shot fired from a rifle and the blow of an ax from a tree
If anyone can help me thanks in advance.