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

/g.lua:44: `=' expected near `end'

Devlinn

Member
Joined
Mar 25, 2015
Messages
295
Reaction score
6
hey, i have error on this script can someone help? thanks

Code:
function onUse(cid, item, frompos, item2, topos)
local tabela = { -- Zajebista nie?
                [1] = {90, 1, 2147},  -- Arm/atk + 1, szansa 90%,ID przedmiotu
                [2] = {70, 2, 2149},  -- Arm/atk +2, szansa 70%,ID przedmiotu
                [3] = {50, 3, 2156},  -- Arm/atk +3, szansa 50%,ID przedmiotu
                [4] = {25, 4, 2155},  -- Arm/atk +4, szansa 25%,ID przedmiotu
                [5] = {15, 5, 2158},  -- Arm/atk +5, szansa 15%,ID przedmiotu
                [6] = {5, 6, 2225},   -- Atk +6, szansa 5%,ID przedmiotu
                [7] = {90, 1, 2145},  -- Def +1, szansa 90%,ID przedmiotu
                [8] = {75, 2, 2150},  -- Def +2, szansa 75%,ID przedmiotu
                [9] = {60, 3, 2153},  -- Def +3, szansa 60%,ID przedmiotu
                [10] = {40, 4, 2146}, -- Def +4, szansa 40%,ID przedmiotu
                [11] = {25, 5, 2154}, -- Def +5, szansa 25%,ID przedmiotu
                }

local config = {-- KONFIGURACJA
                        check = math.random(1,100),
                        item1pos = {x=427, y=914, z=7, stackpos=255},
                        item2pos = {x=428, y=914, z=7, stackpos=255},
                        transform = doTransformItem(item.uid,item.itemid+1)
                }

                getitem1 = getThingfromPos(config.item1pos) -- Po za konfiguracja bo wygodniej
                getitem2 = getThingfromPos(config.item2pos) -- Po za konfiguracja bo wygodniej

    if item.uid == 5444 and item.itemid == 1946 then
        doTransformItem(item.uid,item.itemid-1)
    end           

  if check.config <= tabela[1][1] then
  if item.uid == 5444 and item.itemid == 1945 and (getitem1.itemid == tabela[1][3] or getitem2.itemid == tabela[1][3]) then
       if isArmor(getitem2.itemid) == 1 then
         setSpecialArmor(getitem2.itemid, tabela[1][2])
        elseif isArmor(getitem1.itemid) == 1 then
         setSpecialArmor(getitem1.itemid, tabela[1][2])
       elseif isWeapon(getitem2.itemid) == 1 then
         setSpecialAttack(item2.itemid, tabela[1][2])
       elseif isWeapon(getitem1.itemid) == 1 then
         setSpecialAttack(item2.itemid, tabela[1][2])
      else
              doPlayerSendTextMessage(cid, 17, "Nie mozesz uzyc tego na tym przedmiocie!")
       end
       transform.config
     end

  else
    if isArmor(getitem2.itemid) == 1 then
         setSpecialArmor(getitem2.itemid, 0)
    elseif isArmor(getitem1.itemid) == 1 then
         setSpecialArmor(getitem1.itemid, 0)
    elseif isWeapon(getitem1.itemid) == 1 then
               setSpecialAttack(getitem1.itemid, 0)
    elseif isWeapon(getitem2.itemid) == 1 then
               setSpecialAttack(getitem2.itemid, 0)
       end
    doPlayerSendTextMessage(cid, 17, "Nie udalo sie!")
    transform.config
  end
 
Last edited:
Solution
The problem is in this line:
Code:
transform.config
It shouldn't be here. Simply remove it. Or its supposed to do something? I don't think so.
hey, i have error on this script can someone help? thanks

Code:
function onUse(cid, item, frompos, item2, topos)
local tabela = { -- Zajebista nie?
                [1] = {90, 1, 2147},  -- Arm/atk + 1, szansa 90%,ID przedmiotu
                [2] = {70, 2, 2149},  -- Arm/atk +2, szansa 70%,ID przedmiotu
                [3] = {50, 3, 2156},  -- Arm/atk +3, szansa 50%,ID przedmiotu
                [4] = {25, 4, 2155},  -- Arm/atk +4, szansa 25%,ID przedmiotu
                [5] = {15, 5, 2158},  -- Arm/atk +5, szansa 15%,ID przedmiotu
                [6] = {5, 6, 2225},   -- Atk +6, szansa 5%,ID przedmiotu
                [7] = {90, 1, 2145},  -- Def +1, szansa 90%,ID przedmiotu
                [8] = {75, 2, 2150},  -- Def +2, szansa 75%,ID przedmiotu
                [9] = {60, 3, 2153},  -- Def +3, szansa 60%,ID przedmiotu
                [10] = {40, 4, 2146}, -- Def +4, szansa 40%,ID przedmiotu
                [11] = {25, 5, 2154}, -- Def +5, szansa 25%,ID przedmiotu
                }

local config = {-- KONFIGURACJA
                        check = math.random(1,100),
                        item1pos = {x=427, y=914, z=7, stackpos=255},
                        item2pos = {x=428, y=914, z=7, stackpos=255},
                        transform = doTransformItem(item.uid,item.itemid+1)
                }

                getitem1 = getThingfromPos(config.item1pos) -- Po za konfiguracja bo wygodniej
                getitem2 = getThingfromPos(config.item2pos) -- Po za konfiguracja bo wygodniej

    if item.uid == 5444 and item.itemid == 1946 then
        doTransformItem(item.uid,item.itemid-1)
    end          

  if check.config <= tabela[1][1] then
  if item.uid == 5444 and item.itemid == 1945 and (getitem1.itemid == tabela[1][3] or getitem2.itemid == tabela[1][3]) then
       if isArmor(getitem2.itemid) == 1 then
         setSpecialArmor(getitem2.itemid, tabela[1][2])
        elseif isArmor(getitem1.itemid) == 1 then
         setSpecialArmor(getitem1.itemid, tabela[1][2])
       elseif isWeapon(getitem2.itemid) == 1 then
         setSpecialAttack(item2.itemid, tabela[1][2])
       elseif isWeapon(getitem1.itemid) == 1 then
         setSpecialAttack(item2.itemid, tabela[1][2])
      else
              doPlayerSendTextMessage(cid, 17, "Nie mozesz uzyc tego na tym przedmiocie!")
       end
       transform.config
     end

  else
    if isArmor(getitem2.itemid) == 1 then
         setSpecialArmor(getitem2.itemid, 0)
    elseif isArmor(getitem1.itemid) == 1 then
         setSpecialArmor(getitem1.itemid, 0)
    elseif isWeapon(getitem1.itemid) == 1 then
               setSpecialAttack(getitem1.itemid, 0)
    elseif isWeapon(getitem2.itemid) == 1 then
               setSpecialAttack(getitem2.itemid, 0)
       end
    doPlayerSendTextMessage(cid, 17, "Nie udalo sie!")
    transform.config
  end

Please read the rules; Rules for the Support board
#8

Don't just edit your post and write "solved", post the solution.
 
The problem is in this line:
Code:
transform.config
It shouldn't be here. Simply remove it. Or its supposed to do something? I don't think so.
 
Solution
Back
Top