Ir para conteúdo

Featured Replies

Postado

boa noite estou com ums erros na distro

podem me ajudar a resolver?

 

[Error - TalkAction Interface]
data/talkactions/scripts/rain_money.lua:onSay
Description:
data/talkactions/scripts/rain_money.lua:52: attempt to compare number with nil
stack traceback:
        data/talkactions/scripts/rain_money.lua:52: in function <data/talkactions/scripts/rain_money.lua:41>

 

-- Script feito por Vitor Bertolucci
-- 18/05/2014

local nme = "Rain Money"

local function rainMoney(cid, multiple)
    if isPlayer(cid) then
        if getPlayerStorageValue(cid, 1281821) >= 100 * multiple then
            return true
        end
        local pos = getCreaturePosition(cid)
        local area = {x = math.random(pos.x - 5, pos.x + 5), y = math.random(pos.y - 5, pos.y + 5), z = pos.z}
        local time_ = math.random(600, 3000)
        local quant = math.random(1, 5)
        if not isWalkable(cid, area, false) or getHouseFromPos(area) then
            local count = 0
            while (getHouseFromPos(area) or not isWalkable(cid,area,false)) and count < 10 do
                count = count + 1
                area = {x = math.random(pos.x - 5, pos.x + 5), y = math.random(pos.y - 5, pos.y + 5), z = pos.z}
                if count == 10 then
                    area = pos
                end
            end
        end
        if getPlayerStorageValue(cid, 1281821) + quant > 100 * multiple then
            addEvent(doSendDistanceShoot, time_ - 200, {x = pos.x + 9, y = pos.y - 8, z = pos.z}, area, 28)
            addEvent(doSendMagicEffect, time_, area, 1)
            addEvent(doCreateItem, time_, 2160, ((100 * multiple) - getPlayerStorageValue(cid, 1281821)), area)
            doPlayerSetStorageValue(cid,722521,-1)
            return true
        else
            addEvent(doSendDistanceShoot, time_ - 200, {x = pos.x + 9, y = pos.y - 8, z = pos.z}, area, 28)
            addEvent(doSendMagicEffect, time_, area, 1)
            addEvent(doCreateItem, time_, 2160, quant, area)
            doPlayerSetStorageValue(cid, 1281821, getPlayerStorageValue(cid, 1281821) + quant)
        end
        addEvent(rainMoney, 200, cid, multiple)
    end
end

function onSay(cid, words, param, channel)
    if param == "" then
        doPlayerSendCancel(cid, gTm(cid,nme,1))
        return true
    end
    
    if getPlayerStorageValue(cid,722521) == 1 then
        doPlayerSendCancel(cid,gTm(cid,nme,2))
        return true
    end

    if tonumber(param) > 0 then
        if tonumber(param) > 50 then
            doPlayerSendCancel(cid,gTm(cid,nme,3))
            return true
        end
        if getPlayerBalance(cid) >= 1000000 * tonumber(param) then
            doPlayerSetStorageValue(cid,722521,1)
            doPlayerSetBalance(cid, getPlayerBalance(cid) - 1000000 * tonumber(param))
            doPlayerSetStorageValue(cid, 1281821, 0)
            rainMoney(cid, tonumber(param))
        else
            doPlayerSendCancel(cid, gTm(cid,nme,4))
        end
    else
        doPlayerSendCancel(cid, gTm(cid,nme,5))
    end
    return true
end
 

 

 

Ajuda @Sttorm @Vodkart

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo