> For the complete documentation index, see [llms.txt](https://madcap.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://madcap.gitbook.io/docs/free-resources/mad-musicgame.md).

# mad-musicgame

## Link

{% embed url="<https://madcap-scripts.tebex.io/package/6717557>" %}

## Introduction

:notes: **mad-musicgame** is a simple rhythm-based mini-game for FiveM. Players press the correct keys as they fall, aiming to hit enough notes to succeed. It can be used for different performance types, including **guitar, singing, and dancing; t**he UI adapts dynamically based on the performance type, with custom intro text, visual cues, and matching sound effects for each type.

The mini-game includes customisable difficulty settings, such as speed, allowed mistakes, and required score, making it flexible for different gameplay scenarios. It can be used on its own or integrated into other resources for more interactive experiences.

While **mad-musicgame** works as a standalone mini-game, it's also a core part of :performing\_arts: [**mad-perform**](/docs/premium-resources/mad-perform.md)**!** If you're looking to expand player interactions, **mad-perform** lets players take the stage - playing the guitar, singing, or dancing - while attracting dynamic crowds and earning rewards. Together, they create a fully interactive performance system, bringing more depth and immersion to your server.

### Preview

{% embed url="<https://youtu.be/FyPV7GCJvRY>" %}

## Installation

1. Drag and drop into your server resources folder.
2. Add `start mad-musicgame` to your `server.cfg`.

## How to use

To start the mini-game, use the export `exports['mad-musicgame']:start` like so:

```lua
exports['mad-musicgame']:start({
	lives = 3, -- How many letters the player can miss.
	speed = 0.3, -- How fast the letters fall down.
	maxScore = 4, -- How many letters the player has to type to win.
	letters = {'W', 'A', 'S', 'D'}, -- Optional. Defaults to all letters.
	performanceType = 'guitar' -- 'guitar', 'singing', 'dancing'.
}, function(result)
	if result then
	    print("success")
		-- Minigame success
	else
	    print("fail")
		-- Minigame failure
	end
end)
```
