Setting up Discord Rich Presence for a FiveM server
Create an application in the Discord developer portal, upload your art (1024×1024), then in a client script call SetDiscordAppId with the application ID, SetDiscordRichPresenceAsset with the art’s key, SetRichPresence with a status line, and optionally SetDiscordRichPresenceAction for up to two buttons.
Every player on your server shows up in their friends’ Discord sidebar as “Playing FiveM”. With Rich Presence you replace that with your server’s logo, name, a live status line and up to two buttons — one of which can take their friends straight to your Discord. It is one small client script and a Discord application, and it is one of the cheapest growth tools a server has.
What players and their friends see
| Element | Set with | Typical content |
|---|---|---|
| Application name | The Discord application itself | Your server name, e.g. “My City RP” |
| Large image | SetDiscordRichPresenceAsset | Your logo or a city shot |
| Large image hover text | SetDiscordRichPresenceAssetText | “mycity.gg” |
| Small image | SetDiscordRichPresenceAssetSmall | A job or rank badge |
| Status line | SetRichPresence | “Patrolling as LSPD · 84/128 online” |
| Buttons (max 2) | SetDiscordRichPresenceAction | “Join Discord”, “Connect” |
Create the Discord application
Open the Discord developer portal, create a new application and name it after your server — that name is what appears as “Playing …”.
- 1Create the application and copy its Application ID from General Information.
- 2Open the Rich Presence art assets section and upload your images.
- 3Give each image a short lowercase key such as
logoorpolice— you reference the key in code. - 4Upload at 1024×1024; Discord strongly recommends that size for Rich Presence art.
The client script
Create a small resource with a client script. The natives are client-side and only need to be set once, except the status line, which you refresh as things change.
local APP_ID = '123456789012345678' -- your Application ID
CreateThread(function()
SetDiscordAppId(APP_ID)
SetDiscordRichPresenceAsset('logo')
SetDiscordRichPresenceAssetText('mycity.gg')
SetDiscordRichPresenceAssetSmall('badge')
SetDiscordRichPresenceAssetSmallText('Serious RP')
SetDiscordRichPresenceAction(0, 'Join our Discord', 'https://discord.gg/yourinvite')
SetDiscordRichPresenceAction(1, 'Website', 'https://mycity.gg')
while true do
local players = #GetActivePlayers()
SetRichPresence(('In the city · %d nearby'):format(players))
Wait(15000)
end
end)fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'GetActivePlayers() on the client only returns players your client currently knows about (those in scope), not the server total. For the real online count, send it from the server — for example in a state bag or with a periodic event.
A status line people want to click
The status line is what makes Rich Presence feel alive. Keep it short (it truncates on narrow profiles) and make it about what the player is doing:
- “On duty · LSPD” — read the job from your framework.
- “Driving in Vinewood” — read the zone with
GetNameOfZoneand a label table. - “In the queue” — while loading, before the character spawns.
Troubleshooting
| Symptom | Fix |
|---|---|
| Still says “Playing FiveM” | Check the Application ID is correct and the resource started; the Discord desktop app must be running. |
| Image missing | The key must match the uploaded asset name exactly; new uploads can take minutes. |
| Buttons missing | Your own profile never shows them — check from another account. URLs must be https. |
| Status never changes | The loop is not running or errors earlier — check the F8 console. |
Common questions
How do I show my server name on Discord in FiveM?
Create a Discord application named after your server and call SetDiscordAppId with its ID from a client script. The application name replaces “FiveM” in the player’s status.
What size should Rich Presence images be?
Discord strongly recommends 1024×1024. Upload them to your application in the developer portal and reference them by key.
How many buttons can Rich Presence have?
Two, set with SetDiscordRichPresenceAction using index 0 and 1.
Why can I not see my own buttons?
Discord hides Rich Presence buttons on your own profile. Other people see them.
Can I use an image URL instead of an uploaded asset?
The classic FiveM natives take the asset key uploaded to your application. Uploading the art to the application is the reliable method.
Does Rich Presence work if the player does not have Discord open?
No. The Discord desktop client must be running on the player’s PC for FiveM to update their presence.
Want a loading screen you never have to debug?
Build it in the browser, export once, and edit it whenever — no HTML, no re-uploads.
Start free