• 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!

[LUA] I Exp Doll Any One Use It Got Effect Said Exp +20%

Owner Maydel

Evolera.Tk
Joined
Aug 16, 2015
Messages
302
Reaction score
40
Location
Egypt
Can SomeOne Help Me Please With Script Lua
The Lua SAid When Any One Use the Double Exp Doll
Get Magic Effect and Said all 5 second Pvp +20%
Can SOme One Made It Please..
 
You'll post your "Bonus Insignia" script? :3
For TFS 1.X? :D.

I will not post the same script but I can share the concept of course :D

Bonus Library:
Code:
bonusTime = 4 * 60 * 60 -- 4 hours
bonusStorage = 123456

Bonus Doll/Action Script
Code:
function onUse(player, item, fromPosition, itemEx, toPosition)
    player:setStorageValue(bonusStorage, os.time() + bonusTime) -- add the bonus time
    item:remove() -- remove the item
    return true
end

data/events/events.xml
Code:
<event class="Player" method="onGainExperience" enabled="1" />

data/events/scripts/player.lua
Find the function "onGainExperience" and add in the storage check and adjust the value of the exp that is returned.
Code:
function Player:onGainExperience(source, exp, rawExp)
    if self:getStorageValue(bonusStorage) > os.time() then
        exp = exp * 1.5 -- (50% bonus)
    end
    return exp
end
 
There exists a tutorial video? How to setup a database for tfs 1.2 ? xD bcus I have no idea how it works :p xD
Is that the problem, why not people using it :p? You just import the scheme.sql which is included in the datapack. If you are fimilar with mysql :)

Found tutorial by @Znote
 
Yeah, I gonna watch the video after I fixed the bullshit bug on my map editor, when I try to open my map- it just load to 52% then bum rme got blocked no idea why.
 
Yeah, I gonna watch the video after I fixed the bullshit bug on my map editor, when I try to open my map- it just load to 52% then bum rme got blocked no idea why.
Make sure it's not a error window, which has popped out in rme but it's not visible. Since other windows is on the top.
 
I will not post the same script but I can share the concept of course :D

Bonus Library:
Code:
bonusTime = 4 * 60 * 60 -- 4 hours
bonusStorage = 123456

Bonus Doll/Action Script
Code:
function onUse(player, item, fromPosition, itemEx, toPosition)
    player:setStorageValue(bonusStorage, os.time() + bonusTime) -- add the bonus time
    item:remove() -- remove the item
    return true
end

data/events/events.xml
Code:
<event class="Player" method="onGainExperience" enabled="1" />

data/events/scripts/player.lua
Find the function "onGainExperience" and add in the storage check and adjust the value of the exp that is returned.
Code:
function Player:onGainExperience(source, exp, rawExp)
    if self:getStorageValue(bonusStorage) > os.time() then
        exp = exp * 1.5 -- (50% bonus)
    end
    return exp
end

Thanks! (:

What's the difference between this script and the one you use on your project? :3
 
Back
Top