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:
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 in ReplicatedStorage 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.
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 named GiftoinModuleConfig. 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:
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:
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.
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)