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 …”.
- Create the application and copy its Application ID from General Information.
- Open the Rich Presence art assets section and upload your images.
- Give each image a short lowercase key such as
logoorpolice— you reference the key in code. - Upload 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. |
Questions
How do I show my server name on Discord in FiveM?
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?
How many buttons can Rich Presence have?
SetDiscordRichPresenceAction using index 0 and 1.Why can I not see my own buttons?
Can I use an image URL instead of an uploaded asset?
Does Rich Presence work if the player does not have Discord open?
Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.
Relevant to what you just read