Giftoin Docs
  • 👋INTRODUCTION
    • Welcome to Giftoin
    • Overview
    • Quick Start
    • FAQs
    • Key Features
  • 🧩API REFERENCE
    • Standards and Conventions
    • Orders API
      • Tokens/Points
      • Collectibles/Cards
      • Collectibles/Random Cards
    • Users API
      • Inventory
      • Progress
    • Error Handling
  • 💻PLATFORM GUIDES
    • Roblox
      • Why use Giftoin?
      • Basic Usage
      • Developer Access
      • Installation
      • Additional Example / Use-Cases
        • Point Reward
        • Daily Reward
        • Advanced Point Distribution System
        • Managed Codes & In-Game Rewards (Coming Soon)
          • Registering Reward Types
      • Tools and Scripts
        • Rotating Script
        • Floating Script
        • Quest System (Coming Soon)
    • Discord
      • Introduction
      • Getting Started
      • Command Reference
      • Role System
      • User Guides
      • Troubleshooting
      • FAQs
    • Wordpress
  • 📚Resources
    • Use Cases
      • Basic
      • eCommerce
      • Games
    • Support
Powered by GitBook
On this page

Was this helpful?

  1. PLATFORM GUIDES
  2. Roblox
  3. Additional Example / Use-Cases
  4. Managed Codes & In-Game Rewards (Coming Soon)

Registering Reward Types

Learn how to define custom reward types for your game.

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):


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:

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)
PreviousManaged Codes & In-Game Rewards (Coming Soon)NextTools and Scripts

Was this helpful?

💻