Jump to content




syntax error


  • You cannot reply to this topic
4 replies to this topic

#1 billysback

  • Members
  • 569 posts

Posted 11 November 2012 - 12:10 PM

The error is on this line:
local choice, price, stuff = getShop(selc, data)

getShop is:
local choices = {}
    choices = {
                 {"|==========|",
                  "| REPAIR 1 |",
                  "|==========|"},
                 {"|============|",
                  "| REPAIR ALL |",
                  "|============|"},
                 {"|==============|",
                  "|UPGRADE ARMOUR|",
                  "|==============|"},
                 {"|==============|",
                  "|UPGRADE DAMAGE|",
                  "|==============|"},
                 {"|================|",
                  "|UPGRADE ACCURACY|",
                  "|================|"},
                 {"|=============|",
                  "|UPGRADE SPEED|",
                  "|=============|"},
                 {"|=================|",
                  "|UPGRADE WEP-SPEED|",
                  "|=================|"},
                 {"|==============|",
                  "|UPGRADE HEALTH|",
                  "|==============|"},
                 {"|===================|",
                  "|UPGRADE EVASIVENESS|",
                  "|===================|"},
              }
    prices = {
                1,
                shp.stat.maxhealth - shp.stat.health,
                150,
                250,
                400,
                100,
                300,
                100,
                350
             }
    
    local pixels = {}
    local choice = choices[sel]
    local price = prices[sel]
    for y=1,#choice do
        local l = choice[i]
        for x=1,string.len(l) do
            local ch = string.sub(l, x, x)
            pixels[#pixels + 1] = art.setPixel(x, y, nil, colors.blue, ch)
        end
    end    
    local pixarr = art.createPixelArray(pixels)
    return choice, price, pixarr

I am so close to releasing this FTL like clone, this is almost the only thing left until I can release it D:)

#2 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 11 November 2012 - 12:18 PM

i dont see anything wrong
can we see the full error and all the code before the error

#3 billysback

  • Members
  • 569 posts

Posted 11 November 2012 - 12:19 PM

The function that the getShop() is in:
local doShop(selc)
    local choice, price, pixarr = getShop(selc, data)
    if data.money - price < 0 then
        msg = "Not enough money!"
    else
        data.money = data.money - price
        if selc == 1 then
            if data.stats.health + 1 > data.stats.maxhealth then
                data.money = data.money + price
            else
                data.stats.health = data.stats.health + 1
            end
        elseif selc == 2 then
            data.stats.health = data.stats.maxhealth
        elseif selc == 3 then data.stats.armour = data.stats.armour + 1
        elseif selc == 4 then data.stats.damage = data.stats.armour + 1
        elseif selc == 5 then data.stats.accuracy = data.stats.accuracy + 1
        elseif selc = 6 then data.stats.speed = data.stats.speed + 1
        elseif selc = 7 then data.stats.wepspeed = data.stats.wepspeed + 1
        elseif selc = 8 then data.stats.health = data.stats.health + 1
        elseif selc = 9 then data.stats.evasivness = data.stats.evasivness + 1 end
    end
end


#4 billysback

  • Members
  • 569 posts

Posted 11 November 2012 - 12:20 PM

EDIT: nvm, I forgot to put function...

#5 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 11 November 2012 - 03:16 PM

i can not emagine a more epic fail

elseif selc = 9 then
= is the assignment operator
not the equal operator





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users