Daily Reward
Simplified Daily Reward System Guide
The Giftoin package includes a built-in daily reward system that handles all the logic on the server-side, including catching the event, processing the claim, and sending the result back to the client.
1. Set Up the Client-Side Script
Create a new
LocalScript
inStarterPlayerScripts
or attach it to the GUI element that will handle the claim button.Create a new instance of
RemoteEvent
inReplicatedStorage
namedClaimGiftoinEvent
Use the following code:
2. Create the Claim Button
Design a GUI with a claim button for your daily reward.
Attach the LocalScript from step 1 to this button.
3. Customize the Reward UI
Implement the
updateUI
function to update your game's UI based on the claim result.You can show success messages, update reward counters, or display error messages as needed.
4. Additional Considerations
The GiftoinModule handles all the server-side logic for daily claims, including:
Catching the ClaimGiftoinEvent
Processing the claim (including checks for 24-hour intervals)
Sending the result back to the client
You don't need to implement any server-side scripts for this functionality.
The system will automatically ensure that players can only claim once every 24 hours.
5. Potential Use Cases
Daily Login Reward: Use this system as is for a daily login reward.
Quest Completion: Trigger the claim when a player completes a daily quest.
By following this simplified guide, you'll have integrated the Giftoin daily reward system into your game. The system handles all server-side logic automatically, allowing you to focus on creating an engaging UI and integrating the reward system into your game's overall design.
Last updated