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

Solved [TFS 1.0] Save character

eduardojuniosm

Full Stack Web Developer
Joined
Dec 16, 2013
Messages
99
Reaction score
35
Location
Brazil
I put a script in my server to when a player say "!save" the char it be saved, but the problem is that when I type"!save" it returns this error:
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/charsave.lua:onSay
data/talkactions/scripts/charsave.lua:5: attempt to index global 'exhaustion' (a nil value)
stack traceback:
   [C]: in function '__index'
   data/talkactions/scripts/charsave.lua:5: in function <data/talkactions/scripts/charsave.lua:4>
My script:
Code:
local waittime = 30
local storage = 5560

function onSay(cid, words, param, channel)
   if(exhaustion.get(cid, storage) == false) then
     Player(cid):save()
     exhaustion.set(cid, storage, waittime)
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu personagem foi salvo com sucesso!")
   else
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Espere "..exhaustion.get(cid, storage).." segundos para salvar novamente!")
   end
   return true
end
Thank you in advance!
 
Back
Top