• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

help me convert script 0.3.7 to tfs 1.2

gohamvsgoku

Member
Joined
Aug 21, 2017
Messages
151
Reaction score
9
Someone help convert this script?
I'll thank you very much

LUA:
function onLogin(cid)

local rate = 1.2 -- 50%
local config = {
true_vip = "You gain "..((rate - 1)*100).."% exp more now!",
false_vip = "If you become VIP you will get "..((rate - 1)*100).."% more experience",
vip = isPremium(cid)
}

if (config.vip == TRUE) then
doPlayerSetExperienceRate(cid, rate)
else
end
return TRUE
end
 
Solution
You are looking for this file [ data/events/players.lua ]
LUA:
function Player:onGainExperience(source, exp, rawExp)
    if not source or source:isPlayer() then
        return exp
    end
             -- Stamina modifier
             if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
             useStamina(self)

Below you put this:
LUA:
local extraExpRate = self:getStorageValue(50500)
if extraExpRate > 1.0 then
exp = exp * (extraExpRate)
end

Login.lua
LUA:
function onLogin(player)
local config = {
rateExp = 1.5, -- +50%
messageVipTrue = 'You gain ' .. ((config.rateExp - 1)*100) .. '% exp more now!',
messageVipFalse = 'If you become VIP you will get ' .. ((config.rateExp - 1)*100) .. '% more experience',
vip =...
You are looking for this file [ data/events/players.lua ]
LUA:
function Player:onGainExperience(source, exp, rawExp)
    if not source or source:isPlayer() then
        return exp
    end
             -- Stamina modifier
             if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then
             useStamina(self)

Below you put this:
LUA:
local extraExpRate = self:getStorageValue(50500)
if extraExpRate > 1.0 then
exp = exp * (extraExpRate)
end

Login.lua
LUA:
function onLogin(player)
local config = {
rateExp = 1.5, -- +50%
messageVipTrue = 'You gain ' .. ((config.rateExp - 1)*100) .. '% exp more now!',
messageVipFalse = 'If you become VIP you will get ' .. ((config.rateExp - 1)*100) .. '% more experience',
vip = player:isPremium(),
storageRate = 50500 }

if config.vip then
player:setStorageValue(config.storageRate, config.rateExp)
else
player:setStorageValue(config.storageRate, 0)
end
return true
end

That would be all ;D
 
Last edited:
Solution
Back
Top