• 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 Trainer Stamina Creaturescript resets from 42:00 to 0

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,740
Solutions
7
Reaction score
541
Location
Canada
Hey there guys, hope everyone is having a good day.
I am having an issue where players stamina is being reset to 0 if they hit 42:00
I think it may have somethings to do with the following section.

Script Link: CreatureEvent - Stamina Training Monk [0.4 / 0.3.7] (https://otland.net/threads/stamina-training-monk-0-4-0-3-7.272216/)
I am currently using Fir3lements 3777: GitHub - Fir3element/3777 (https://github.com/Fir3element/3777)

Code:
    local stamina_to_add = getPlayerStamina(attacker) + config.stamina_gain
    if stamina_to_add >= 2520 then
        stamina_to_add = 2520 - getPlayerStamina(attacker)
    end
    if stamina_to_add <= 0 then -- stamina is already full
        return true
    end

Full stamina on my server is stored in miliseconds and looks like "151200000" this when full.
Does anyone have ideas why this may be happening?
[In the mean time I will try to find a solution by printing "getPlayerStamina" and trying to determine the proper value it should be set at.]
 
Back
Top