# Managed Codes & In-Game Rewards (Coming Soon)

Welcome to Giftoin's Managed Codes & In-Game Rewards system! This powerful tool allows you to easily implement a secure and flexible code redemption system in your Roblox game.

Key features:

* Instant implementation with GiftoinModule
* Secure server-side processing
* Flexible reward types
* Customizable UI integration
* Centralized code management through Giftoin platform

By using our system, you can focus on creating unique gameplay experiences while we handle the complexities of code management and reward distribution.

### Register Reward Type

Our module is built in a modular way - allowing all kinds of rewards.&#x20;

You simply need to register each reward type - name and the function to run to grant the reward to the user.

```lua
-- For updating leaderboard stats

local ServerScriptService = game:GetService("ServerScriptService")
local GiftoinModule = require(ServerScriptService:WaitForChild("GiftoinModule"):WaitForChild("init"))
local GiftoinRedemptionSystem = GiftoinModule.Redemption

GiftoinRedemptionSystem.RegisterCallback("points", function(player, amount)
	print("points added")
	local leaderstats = player:FindFirstChild("leaderstats")
	if leaderstats then
		local points = leaderstats:FindFirstChild("Points")
		if points then
			points.Value = points.Value + amount
		end
	else
		print("Player leaderstats are missing")
	end
end)

```
