• 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 help stamina regen on trainers (BUG) 0.3.6

Vitich

Member
Joined
Nov 28, 2012
Messages
266
Reaction score
11
Hi to all, I've got a problem with a movement script.

Lua:
STAMINA_MESSAGE = "You won 1 minute of stamina."
STAMINA_TIME = 180 * 1000
STAMINA_EFFECT = 12
STAMINA_ADD = 1

function event(cid)
    if isPlayer(cid) then
        doPlayerAddStamina(cid, STAMINA_ADD)       
        doPlayerSendTextMessage(cid, 27, STAMINA_MESSAGE)
        eventCheck = addEvent(event, STAMINA_TIME, cid)
    end
end

function onStepIn(cid, item, position, fromPosition, pos)
    if isPlayer(cid) then
    doPlayerSendTextMessage(cid, 27, "Every 3 minutes of training you gain 1 minute of stamina.")
    eventCheck = addEvent(event, STAMINA_TIME, cid)
    end
    return true
end

function onStepOut(cid, item, position, fromPosition)
    if isPlayer(cid) then
        doPlayerSendTextMessage(cid, 27, "You left the training area.")
        stopEvent(eventCheck)
    end
    return true
end

It working fine, but when a player die, he get full stamina.... so, idk why it happen.


Thank you all guys :)
 
Back
Top