• 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 [TALKACTIONS] (8.60) ERROR Script /b Broadcast For Player Vips

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
[TALKACTIONS] (8.60) ERROR Script /b Broadcast For Player

ERROR:
Lua:
[09/12/2019 22:56:06] [Error - TalkAction Interface]
[09/12/2019 22:56:06] data/talkactions/scripts/fone.lua:onSay
[09/12/2019 22:56:06] Description:
[09/12/2019 22:56:06] data/lib/034-exhaustion.lua:28: attempt to perform arithmetic on local 'time' (a nil value)
[09/12/2019 22:56:06] stack traceback:
[09/12/2019 22:56:06]     data/lib/034-exhaustion.lua:28: in function 'set'
[09/12/2019 22:56:06]     data/talkactions/scripts/fone.lua:37: in function <data/talkactions/scripts/fone.lua:19>

Script:
Lua:
------ Script By MatheusMkalo for Xtibia.com Users -------

local configs = {

cobrar = "sim", ------ Use sim ou nao para cobrar.

sovip = "sim", ------ Se somente vip players poderam usar o comando

price = 1000000, ------ Preço a pagar se o cobrar estiver ativado.

time = 100, ------ Tempo do exhaust.

storagetime = 80124, ------ nao mecha.

storage = 13545 ------ Storage Id da sua vip account caso for usar somente vips

}

function onSay(cid, words, param)

local nada = {" "}



if table.isStrIn(param, nada) or param == "" then

doPlayerSendCancel(cid,"Voce precisa falar alguma coisa.")

return TRUE

end



if exhaustion.check(cid, storagetime) == false then

exhaustion.set(cid, storagetime, time)

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are exhausted for: " ..exhaustion.get(cid, storagetime).." seconds.")

end



if configs.sovip == "sim" and getPlayerStorageValue(cid, tonumber(configs.storage)) - os.time() <= 0 then

doPlayerSendCancel(cid,"Você não é vip.")

return TRUE

end



if configs.cobrar == "sim" and not doPlayerRemoveMoney(cid,tonumber(configs.price)) then

doPlayerSendCancel(cid,"Você não tem dinheiro suficiente.")

return TRUE

end



doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: " .. param .. "", MESSAGE_INFO_DESCR)

return TRUE

end

HELP ME!
 
Solution
for sure in following lines u should be accessing configs table.

Lua:
if exhaustion.check(cid, storagetime) == false then
exhaustion.set(cid, storagetime, time)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are exhausted for: " ..exhaustion.get(cid, storagetime).." seconds.")
end

I mean in used variables:
storagetime -> configs.storagetime
time -> configs.time
like:

Lua:
if exhaustion.check(cid, configs.storagetime) == false then
exhaustion.set(cid, configs.storagetime, configs.time)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are exhausted for: " ..exhaustion.get(cid, configs.storagetime).." seconds.")
end
for sure in following lines u should be accessing configs table.

Lua:
if exhaustion.check(cid, storagetime) == false then
exhaustion.set(cid, storagetime, time)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are exhausted for: " ..exhaustion.get(cid, storagetime).." seconds.")
end

I mean in used variables:
storagetime -> configs.storagetime
time -> configs.time
like:

Lua:
if exhaustion.check(cid, configs.storagetime) == false then
exhaustion.set(cid, configs.storagetime, configs.time)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are exhausted for: " ..exhaustion.get(cid, configs.storagetime).." seconds.")
end
 
Solution
Back
Top