Popular Post Hydra Posted November 7, 2023 Popular Post Share Posted November 7, 2023 1. We create an application in https://discord.com/developers/applications 2. We copy the application id: 3. Now we are making the script (start with creating a .lua file) --// discord_c.lua local app_id = "your_app_key_here" function ConnectRPC() setDiscordApplicationID(app_id) if isDiscordRichPresenceConnected() then local name = getPlayerName(localPlayer) iprint("RPC: Discord RPC is now connected") setDiscordRichPresenceAsset("your_app_logo_string", "Yey, this is my app logo") setDiscordRichPresenceButton(1, "Join Discord", "url_here") setDiscordRichPresenceButton(2, "Connect Server", "url_here") --// NOTE: you can show only 2 buttons setDiscordRichPresenceState("Playing") setDiscordRichPresenceDetails("Playing as: "..name) else iprint("RPC: Discord RPC failed to connect") end end addEventHandler("onClientResourceStart", resourceRoot, ConnectRPC) --// Now, we reset the rpc details so the status will not be bugged addEventHandler("onClientResourceStop", resourceRoot, function() resetDiscordRichPresenceData() end) 4. So, we have our discord_c.lua file and now we need to create the meta.xml <meta> <info author="YourName" description="YourResourceDescription" type="YourScriptType", version="1.0" /> <script src="discord_c.lua" type="client" cache="false" /> </meta> 5. In the console you can now type refresh and after start theResourceName 2 2 Link to comment
FernandoMTA Posted November 12, 2023 Share Posted November 12, 2023 (edited) Nice guide! You can upload images to your application on the Discord Developers Platform; these are called "assets" and have a name. You can use these asset names in the first argument of setDiscordRichPresenceAsset. For example: -- will display my server's logo asset image -- with the server name text when mouse hovered over the image setDiscordRichPresenceAsset("my_logo", "Server Name") Edited November 12, 2023 by FernandoMTA 2 Link to comment
Recommended Posts