How to make button in Title menu

In my game, I start the gameplay after clicking the left mouse button:

		if event is InputEventMouseButton:
			if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
				if game_running == false:
					start_game()

But I would like to add a mute button to the main screen. But when you add such a button, when you click on it, the gameplay begins. How can I fix this?
I use tuttorial - https://youtu.be/9f9t9eiCDAA?si=X1wTH9BxsWV2Bh5q

Hmm, forgive me please if I misunderstand your post. It looks like, as far as I can tell, right now when you click the mouse button left, and the game is not running, you start your game.

If you are also clicking the left mouse button to mute the game, you could be having a problem as right now left m ouse button starts the game.

I used buttons to start my game: BaseButton — Godot Engine (stable) documentation in English

so if that BUTTON is pressed, the game starts. It doens’t start the game if you click outside the button, though. You could have one button for mute and one for start game, for example. And click on which one you desire to use.

I can’t really give code examples, or at least not without translating to godot 4, because my game is still in godot 3. (Im laggin behind :stuck_out_tongue: ) But I hope this gets you on the right track

you need add another if
and dont forget the reference to your mute_button

func _input(event: InputEvent) -> void:
	if event is InputEventMouseButton:
		if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
			if mute_button.is_hovered():
				print("mute")
			else:
				if game_running == false:
					print("start game")

Its great idea, but its not work. Pressing the button is simply ignored and the gameplay begins. Maybe you need to somehow supplement the verification code so that it works correctly?

Try check this inside the _unhandled_input callback instead the _input