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

Stamina Modify Problem

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
549
Solutions
32
Reaction score
305
Location
Poland
GitHub
AscuasFunkeln
Hello i have little problem, im new in making scripts and need little help :p

I want turn"Stamina" into "EXP Boost"
I make Item that Refill Stamina by "x" minutes, but now i have bigger problem.
Thats should work like that:
0 Stamina = Normal EXP (1X)
More than 0 Stamina = Double EXP (2x)

config.lua of TSF cant set this. Soo i make this, but its not work and idk why xD

Lua:
  function onLogin(cid)
        local staminaMinutes = getPlayerStamina(cid)
        if staminaMinutes > 1 then
        getPlayerRates(cid)
        doPlayerSetExperienceRate = 2.0
        elseif staminaMinutes == 0 then
        getPlayerRates(cid)
        doPlayerSetExperienceRate = 1.0
        end
        end

And when i launch server i try login. There is no errors, but cant login to game.
[14/04/2018 14:04:28] Tester has logged in.
[14/04/2018 14:04:28] Tester has logged out.
[14/04/2018 14:04:31] Tester has logged in.
[14/04/2018 14:04:31] Tester has logged out.
[14/04/2018 14:04:33] Tester has logged in.
[14/04/2018 14:04:33] Tester has logged out.

Please help :(

@edit i forgott, using server : The Forgotten Server - version 0.3.6 - Edited By Cyko V8 Crying Damson
 
OK, i fix it. This work
Lua:
  function onLogin(cid)
        local config = {
    expend = 0,
    expstart = 1}
        staminaMinutes = getPlayerStamina(cid)
        if staminaMinutes >= config.expstart then
        doPlayerSetRate(cid, SKILL__LEVEL, 2)
        else if staminaMinutes == config.expend then
        doPlayerSetRate(cid, SKILL__LEVEL, 1)
        end
        end
        return true
        end

But need relog to activate, i try add onUse and onThink fuction but anything work xD Any ideas? I try use onUse function with item that add stamina, but this duplicate item and not work, maybe instert this "stamina script" into "staminarefil" script will solve problem?

How rly work function "onThink"
Now problem is, make it working on using item, and when stamina end in game to stop bonus. xD
 
Last edited:
Back
Top