# Registering Reward Types

The GiftoinModule allows you to register custom reward types that fit your game's economy. \
Here's how to register a reward type(place it in a server-side script in `ServerScriptService`):

```lua

GiftoinModule.RegisterRewardType("Currency", function(player, amount)
    -- Add currency to player's account
    local leaderstats = player:FindFirstChild("leaderstats")
    if leaderstats then
        local currency = leaderstats:FindFirstChild("Currency")
        if currency then
            currency.Value = currency.Value + amount
        end
    end
end)

```

You can register multiple reward types:

```lua
GiftoinModule.RegisterRewardType("Item", function(player, itemId)
    -- Give item to player
    -- Your item granting logic here
end)

GiftoinModule.RegisterRewardType("Experience", function(player, expAmount)
    -- Add experience to player
    -- Your experience granting logic here
end)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.giftoin.org/platform-guides/roblox/additional-example-use-cases/managed-codes-and-in-game-rewards-coming-soon/registering-reward-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
