Ghost's Music Player
An easy-to-use music player for your game. It includes animations, mood-based music, and an example you can drop into your game.
Overview
This is a drag and drop music system for Roblox. The demo place has everything working out of the box. Just open it and hit play.
What's included:
- Demo place with working examples
- Music player with animated UI
- Zone system (music changes based on location)
- Mood-based playlists
- All the scripts you need
Features
Quick Start
1. Open the demo place
Grab the .rbxl file and open it in Roblox Studio. Hit play and everything's already
wired
up.
2. Walk around
Try walking in and out of the shop. The music switches automatically. That's the zone system at work.
3. Check the example script
Look inside:
StarterPlayer
└── StarterPlayerScripts
└── LocalScript
This shows how music changes work. Here's the gist:
MusicPlayer:SetMood("Shop")
MusicPlayer:Play()
Copy this pattern for your own zones.
Included Tracks
The demo comes with two example tracks in:
SoundService
└── Tracks
Moods included:
- Shop
- Outside
Swap them out with whatever you want.
Adding Your Music
Drop your Sound objects into SoundService/Tracks
Optional metadata you can add:
| Name | Type | What it does |
|---|---|---|
| Artist | StringValue | Shows artist name |
| AlbumCover | StringValue | Shows album art |
| Mood | StringValue | Groups music by mood |
Make sure you have permission to use the audio. Don't enable the "Playing" property - the system handles that.
Moods
Moods are basically tags that group tracks together. Use them like this:
MusicPlayer:SetMood("Combat")
MusicPlayer:SetMood("Dungeon")
MusicPlayer:SetMood("SafeZone")
If a mood doesn't exist or has no tracks, it'll just play everything.
Basic Controls
MusicPlayer:Play()
MusicPlayer:Pause()
MusicPlayer:Stop()
MusicPlayer:Next()
MusicPlayer:SetMood("Shop")
MusicPlayer:SetVolume(0.7)
Using It In Your Game
To use this in your actual game, copy over:
- All music modules
- MusicPlayerGUI
- The Tracks folder
Then kick it off with:
_G.MusicPlayer:Play()
Music Zones
Zones let you change music based on location. Works well for:
- Shops
- Boss fights
- Safe areas
- Caves and dungeons
- Day/night areas
Just duplicate the example zone from the demo and tweak as needed.
Performance
- Runs client-side - no server stress
- Lightweight and optimized
- Won't tank framerate
Multiplayer
By default, zones are client-side for smooth transitions. If you want server-controlled music (synchronized across players), wire up some RemoteEvents.
Troubleshooting
Music won't play
- Double-check your tracks are in
SoundService/Tracks - Verify audio permissions (needs to be yours or allowed)
- Mood names are case-sensitive
UI is missing
Check that MusicPlayerGUI is sitting in StarterGui
Zones aren't working
Verify the zone script is in place and the parts are set up correctly
Start with the demo. Play around, see how it works, then copy what you need into your game. It's way easier than starting from scratch.