Installation
To add the Giftoin Module to your Roblox game you need to simply download the module and import it to your game accordingly to the detailed guide below:
Download Giftoin Module file:
Navigate to and select the downloaded
.rbxmx
file.
Place in ServerScriptService:
Right click
ServerScriptService
in your Explorer panel.Select "Insert Object"
Select the GiftoinModule file you just downloaded
The GiftoinModule folder & config will be imported to your
ServerScriptService
Create Additional Objects (optional) : Create multiple
RemoteEvent
inReplicatedStorage
as needed and mentioned in further guides in this docs.
Verifying Installation
Regardless of the method you choose, ensure that the Giftoin Module is properly placed in ServerScriptService
. This location is crucial for the module to function correctly and securely.
File Structure
GiftoinModule (Folder)
├── init.lua
├── API.lua
├── Utils.lua
├── Events.lua
├── [Other module files]
GiftoinModuleConfig (File)
Authenticating with Your API Key
To use the Giftoin API, you need to authenticate using your API key. We've simplified this process by using a config file within the GiftoinModule.
Steps to Set Up Authentication
Locate the Config File: In the
ServerScriptFolder
folder, you'll find a file namedGiftoinModuleConfig
. This file is outside of the GiftoinModule folder to enable you to upgrade to future versions easily without resetting your config each time.Enter Your API Key: Look for the
API_KEY
variable and replace the placeholder value with your actual API key:return { API = { BASE_URL = "https://api.giftoin.org/v1/api-reseller/api/v1", API_KEY = "123" }, }
Save the File: After entering your API key, save the file.
Using the API
With your API key set in the settings file, the Giftoin Module will automatically handle authentication for all API calls. You don't need to manually authenticate in your scripts.
To use the Giftoin API in your game scripts, simply require the module as usual:
local ServerScriptService = game:GetService("ServerScriptService")
local GiftoinModule = require(ServerScriptService:WaitForChild("GiftoinModule"):WaitForChild("init"))
local GiftoinEvents = GiftoinModule.Events
--local claimGiftoinEvent = game.ReplicatedStorage.GiftoinModule.ClaimGiftoinEvent
-- Create the ClaimGiftoinEvent if it doesn't exist
local claimGiftoinEvent = game.ReplicatedStorage:FindFirstChild("ClaimGiftoinEvent")
if not claimGiftoinEvent then
claimGiftoinEvent = Instance.new("RemoteEvent")
claimGiftoinEvent.Name = "ClaimGiftoinEvent"
claimGiftoinEvent.Parent = game.ReplicatedStorage
end
claimGiftoinEvent.OnServerEvent:Connect(function(player)
GiftoinEvents.claimDaily(player)
end)
Security Note
Remember to keep your GiftoinModuleConfig
file secure and never share it publicly.
If you're using version control, make sure to add this file to your .gitignore
to prevent accidentally committing your API key.
Was this helpful?