RSG Framework
Getting Started

Your First Resource

Build a simple resource on top of RSG Framework.

Let's build a tiny resource that rewards a player with cash when they use a command. This introduces the core object, server callbacks and player functions.

1. Create the resource

Inside your [rsg] folder, create a new resource named rsg-reward:

[rsg]/rsg-reward/
├── fxmanifest.lua
├── client.lua
└── server.lua

2. The manifest

fxmanifest.lua
fx_version 'cerulean'
game 'rdr3'
rdr3_warning 'I acknowledge that this is a prerelease build of RedM.'

author 'you'
description 'Give a cash reward on command'

shared_script '@rsg-core/shared/locale.lua'

client_script 'client.lua'
server_script 'server.lua'

3. Server logic

Grab the core object and use player functions to add money:

server.lua
local RSGCore = exports['rsg-core']:GetCoreObject()

RegisterCommand('reward', function(source)
    local Player = RSGCore.Functions.GetPlayer(source)
    if not Player then return end

    Player.Functions.AddMoney('cash', 50, 'used-reward-command')
    TriggerClientEvent('ox_lib:notify', source, {
        title = 'Reward',
        description = 'You received $50!',
        type = 'success',
    })
end, false)

4. Client logic

For this example the client stays empty, but this is where you would add UI, props or animations:

client.lua
-- client-side logic goes here

5. Enable it

Add the resource to your server.cfg after rsg-core:

ensure rsg-reward

Restart your server and run /reward in-game — you should receive $50.

What you learned

You used GetCoreObject() to access RSG, GetPlayer(source) to fetch a player, and Player.Functions.AddMoney to modify their balance. These same building blocks power every RSG resource.

Where to go next

On this page