eduardojuniosm
Full Stack Web Developer
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:
My script:
Thank you in advance!
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>
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