athenso
Average Coder
- Joined
- May 31, 2011
- Messages
- 155
- Solutions
- 3
- Reaction score
- 23
I created an action script to partner with the script TFS 1.x Global (EXP/Skill/Magic) Rate Boost
I wanted a way for my players to boost the server for a small fee when there is no admin online.
Terrible screenshot to show the checks
I wanted a way for my players to boost the server for a small fee when there is no admin online.
- Checks to see if a boost is already in use (if so will not let the player boost)
Code:
local config = {
['exp'] = {skillKey = 17585, timeKey = 17589},
['skill'] = {skillKey = 17586, timeKey = 17590},
['magic'] = {skillKey = 17587, timeKey = 17591}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if getGlobalStorageValue(17589) < os.time() then --Dont touch. Checking the time
if player:removeItem(2160, 100) == true then --Change the item id to whatever you want players to pay with
setGlobalStorageValue(17585, 50) --Change the Storage Value to whatever "skill" you want boosted
setGlobalStorageValue(17589, os.time() + 1 * 60 * 60) -- Only touch if you know what you are doing.
broadcastMessage(player:getName() .. " have activated the global 50% exp rate boost for next hour!", MESSAGE_STATUS_WARNING)
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must pay 100cc to boost the server exp rate.")
end
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is already a boost active.")
end
return false
end
Terrible screenshot to show the checks