• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[TFS 1.2] Daily Rewards Script

RevoXeli

Member
Joined
Feb 6, 2024
Messages
7
Reaction score
7
Hey everyone,

I've been fine-tuning some features over at my server, Tibia.nu, and I've put together a little something that might interest many of you. It's a daily rewards system designed to give players a nice little boost for logging in each day. Given how well it's been received on my server, I thought it might be something worth sharing with the wider community.

Introducing the Daily Rewards Script:

This script automatically awards players with a random amount of gold coins each day when they log in. The amount varies from a minimum of 5,000 to a maximum of 20,000 gold coins, keeping things exciting and rewarding for everyone involved.

Scripts:

  • DailyRewards.lua: Handles the logic for determining if a player is eligible for their daily reward and then awards them a random amount of gold coins.
How to Implement It:

Setting up this script on your server is straightforward. You need to place the DailyRewards script in your scripts directory and then register it in your creaturescripts.xml file to trigger upon player login.

Step-by-Step Guide:

  • Save the Lua script as DailyRewards.lua in your server's scripts directory, e.g. Server\data\creaturescripts\scripts\DailyRewards.lua
  • Add the following entry to your creaturescripts.xml to register the script:
LUA:
<event type="login" name="DailyRewards" script="DailyRewards.lua"/>

Make sure to adjust the script path if you place it in a subdirectory within the scripts directory.

Remember to restart your server after making these changes to ensure everything works smoothly.

Customizing Your Rewards:

To customize the rewards to better fit your server or to add variety, you can modify the minReward and maxReward variables within the script for different gold amounts. Additionally, you could expand the rewards array to include specific items or even implement a tiered rewards system based on player activity or achievements.
 

Attachments

Hey everyone,

I've been fine-tuning some features over at my server, Tibia.nu, and I've put together a little something that might interest many of you. It's a daily rewards system designed to give players a nice little boost for logging in each day. Given how well it's been received on my server, I thought it might be something worth sharing with the wider community.

Introducing the Daily Rewards Script:

This script automatically awards players with a random amount of gold coins each day when they log in. The amount varies from a minimum of 5,000 to a maximum of 20,000 gold coins, keeping things exciting and rewarding for everyone involved.

Scripts:

  • DailyRewards.lua: Handles the logic for determining if a player is eligible for their daily reward and then awards them a random amount of gold coins.
How to Implement It:

Setting up this script on your server is straightforward. You need to place the DailyRewards script in your scripts directory and then register it in your creaturescripts.xml file to trigger upon player login.

Step-by-Step Guide:

  • Save the Lua script as DailyRewards.lua in your server's scripts directory, e.g. Server\data\creaturescripts\scripts\DailyRewards.lua
  • Add the following entry to your creaturescripts.xml to register the script:
LUA:
<event type="login" name="DailyRewards" script="DailyRewards.lua"/>

Make sure to adjust the script path if you place it in a subdirectory within the scripts directory.

Remember to restart your server after making these changes to ensure everything works smoothly.

Customizing Your Rewards:

To customize the rewards to better fit your server or to add variety, you can modify the minReward and maxReward variables within the script for different gold amounts. Additionally, you could expand the rewards array to include specific items or even implement a tiered rewards system based on player activity or achievements.
Nice code dude, ill test it
 
Back
Top