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

Newast TFS Server About mod Folder

zibos

New Member
Joined
Jan 1, 2014
Messages
19
Reaction score
0
Hi there!

It was long time ago I hade a server online so I want to know where the mod folder?

I want to build some script..


Is the XML folder is the old MOD folder? If it is should I use all path like value="/server/action/foldername/luaname.lua"


Thanks :)
 
You can't use mods on tfs 1.0 without major changes to the source code. You will have to "split" it up to pieces, using then a lib folder to load the config. Remember to first check this file: https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp
if the function actually exists in tfs 1.0.

About adding exp scrolls and thing like that do as Limos said, just use the same script and change the event="script" value=".." to script=".." .. beign your script path. But the best thing to do is to update all your scripts to meta insted of the older functions if you want to optimize the server to use less ram.
 
I try with this one: http://otland.net/threads/mod-experience-scroll-with-time-expire.147551/


I put this in action.xml

<mod name="Experience Stages Scroll" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes">
<action itemid="9004" event="script" value="myscript/expstagescroll.lua"/>
<creatureevent type="think" name="ExpStage" event="script" value="myscript/expstagescroll.lua"/>
<creatureevent type="login" name="ExpStageLogin" event="script" value="myscript/expstagescroll.lua"/>
</mod>


And the lua file in new folder that i crate inside script:


local config = { rate = 2,storage = 1000,expstorage = 1100,register = 1200,time = 14400,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) <= 0 then
local rates = getPlayerRates(cid)setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL])setPlayerStorageValue(cid, config.register, 1)itemEx=itemid == 9004
doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid)setPlayerStorageValue(cid, config.storage, os.time()+config.time)doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*config.rate)doRemoveItem(item.uid,1)registerCreatureEvent(cid, "ExpStage")
elsedoCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid)endreturn true
endfunction onThink(cid, interval)
if getPlayerStorageValue(cid, config.register) == 1 thenif getPlayerStorageValue(cid, config.storage) <= os.time() then
doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid)setPlayerStorageValue(cid, config.storage, 0)setPlayerStorageValue(cid, config.register, 0)local oldexp = getPlayerStorageValue(cid, config.expstorage)doPlayerSetExperienceRate(cid, oldexp)unregisterCreatureEvent(cid, "ExpStage")end
endreturn true
endfunction onLogin(cid)
if getPlayerStorageValue(cid, config.register) == 1 then
registerCreatureEvent(cid, "ExpStage")local rates = getPlayerRates(cid)doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid)
if getPlayerStorageValue(cid, config.storage) > os.time() then
local oldexp = getPlayerStorageValue(cid, config.expstorage)doPlayerSetExperienceRate(cid, oldexp+config.rate)end
end return true
end


And restart server but it is not working.
 
Back
Top