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

Talkaction for exp booster

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
Hello, i found pretty good working exp booster here:

But the problem i have is i want to make talkaction for players to let them check out how much time left of booster/to use new one.

Those are mine tries:
Code:
if getPlayerStorageValue(cid, config.storage) == 1  then

  doPlayerSendCancel(cid, "The EXP POTION Effect Ends in ".. getPlayerStorageValue(cid, config.storage, os.time()+config.time)..". ")
 
 
 
 
    doPlayerSendCancel(cid, "The EXP POTION Effect Ends in "..config.time..". ") to pokazuje ciagle config.time
    
    
    
    
    function onSay(cid)
if isPlayer then
  if getPlayerStorageValue(cid, config.register) == 1 and getPlayerStorageValue(cid, config.storage) >= os.time() then

    doPlayerSendCancel(cid, "The EXP POTION Effect Ends in "..getPlayerStorageValue(cid, config.storage, os.time()+config.time)..". ")
    
    
    
    
    
    
    function onSay(cid)
if isPlayer then

if exhaustion.check(cid, config.storage, os.time()+config.time) then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Your bonus experience is still active. Left: ' ..exhaustion.get(cid, config.storage, os.time()+config.time) ..' seconds.')
    
    else
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'You havent used any exp boost!')
    end
    end
    return true


end



  if getPlayerStorageValue(cid, config.register) == 1 and getPlayerStorageValue(cid, config.storage) >= os.time() then

    doPlayerSendCancel(cid, "The EXP POTION Effect Ends in "..getPlayerStorageValue(cid,os.time()+config.time)..". ")
    
    to sie ENDS IN -1
    creaturenot found
    
    
    
        function onSay(cid)
if isPlayer then
  if getPlayerStorageValue(cid, config.register) == 1 and getPlayerStorageValue(cid, config.storage) >= os.time() then
local  i == (config.time*60-(os.time()-getPlayerStorageValue(cid, storage)))
    doPlayerSendCancel(cid, "The EXP POTION Effect Ends in ".. getPlayerStorageValue(cid, config.time)..". ")
doPlayerSendCancel ((config.time*60-(os.time()-getPlayerStorageValue(cid, storage)))-i)*1000, cid, "O Efeito da Potion Termina em "..a..".")
    
    else
        doPlayerSendCancel(cid, "The EXP POTION isnt active. ")
    end
    end
    return true
    end
But its not working, or got error with creatureNotFound, or no errors but talkaction isnt works.....

Ofc i added talkaction to mod

and last try i used is already makes me crazy XD
Code:
  if getPlayerStorageValue(cid, config.register) == 1 and getPlayerStorageValue(cid, config.storage) > os.time() then

    doPlayerSendCancel(cid, "The EXP POTION Effect Ends in "..(config.time-(os.time()-getPlayerStorageValue(cid,storage))*1000)..". ")

end



if  getPlayerStorageValue(cid, config.storage, 0) and getPlayerStorageValue(cid, config.register, 0) then
  doPlayerSendCancel(cid, "You doesnt activated any EXP POTION.")
  end
 
return true
end
This one shows about 15kk? left till new use XD
What shall i do? add exhaust storage? Any tips/help/pls? ;x


tfs 0,4 tibia 8,6 rev 3777
 
Ok i have solved the problem by adding and using this talkaction:

Code:
function onSay(cid)


local last = math.floor((getPlayerStorageValue(cid, 10000) - os.time())/60)  -- minutes
local last2 = ((getPlayerStorageValue(cid, 10000) - os.time()))  -- seconds






if isPlayer then
if getPlayerStorageValue(cid, config.register) == 1 then
    doPlayerSendCancel(cid, 'Your bonus experience time  : '.. last2.. ' seconds.')
end

if getPlayerStorageValue(cid, config.register) == 0 then
        doPlayerSendCancel(cid, 'You dont have any exp bonus!')
        end
    end
    return true
end

But got another problem, even if i use:
doPlayerSendCancel(cid, 'Your bonus experience time : '.. last.. ' : '.. last2.. ' .')

It show me:

Your bonus experience time 2:120
So here is the problem how to convert it to show hh:mm:ss
Like it should be time 2:00 then 1:59 etc ;p not to count both together, please help ;x
 
Last edited:
Back
Top