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

lion rock reward

Lais Prad

Disgusting Scammer
Joined
Apr 12, 2017
Messages
153
Solutions
6
Reaction score
15
Hello, I got an error in line 92 on screen, someone can help?
Script:
tfs 1.2

line 91: local reward = lionrock.rewards[math.random(0, #lionrock.rewards - 1)]
line 92: count = reward.count and reward.count or 1

lib:

Lua:
lionrock = {
    items = {
        nflower = 23759,
        flower = 23760,
        holywater = 23835,
      
        tongue = 10551,
      
        scroll = 25521,
      
        ruby = 2147,
        sapphire = 2146,
        amethyst = 2150,
        topaz = 9970,
      
        rewardfountain = 6390,
      
        redflame = 1488,
        yellowflame = 1500,
        blueflame = 8058,
        violetflame = 7473
    },
    -- For information only..
    actionIds = {
        getFlower = 41354,
        getWater = 41355,
        getScroll = 41356,
      
      
    },
    storages = {
        getFlower = 50881,
        usedFlower = 50882,
      
        getHolyWater = 50883,
        usedHolyWater = 50884,
      
        usedTongue = 50885,
      
        getScroll = 50886,
      
        firstMysticEnter = 50887,
      
        translation1 = 50888,
        translation2 = 50889,
        translation3 = 50890,
        translation4 = 50891,
      
        playerCanDoTasks = 50892,
      
    },
  
    positions = {
        ruby = { x = 33069, y = 32298, z = 9 },
        sapphire = { x = 33069, y = 32302, z = 9 },
        amethyst = { x = 33077, y = 32302, z = 9 },
        topaz = { x = 33077, y = 32298, z = 9 },
    },
  
    -- Global Variaables used in all situations;
    taskactive = {
        ruby = false,
        sapphire = false,
        amethyst = false,
        topaz = false
    },
  
    rewards = {
        { id = 23810}, -- Lion's heart
        { id = 9971 }, -- Gold ingot
        { id = 2154 }, -- Yellow gem
        { id = 2156 }, -- Red gem
        { id = 2127 }, -- Emerlad bangle
        { id = 7633 }, -- Giant shimmering pearl
    },


~~~~~
 
We will guess the script without you provide the code, good. Also, I think the code is from Viking's OT, I higly recommend you create yourself the quest. I checked a few months ago and seems fucked.
 
Please read the rules; Rules for the Support board
#5, #7

You say that the error is a line 91 or 92? But the code you posted is only 78 lines long.
The code lines you posted does not match the script you linked either = you have modified it or it has been modified on github since you got the script.

And what is the error that you are getting?
 

But you still havn't posted everything :p
Lua:
local reward = lionrock.rewards[math.random(0, #lionrock.rewards - 1)]
count = reward.count and reward.count or 1

Those are the two lines we need to check.

Lua:
lionrock.rewards
We need to try and find that table and it's here; master/lionrock.lua at b0302167eb5ec4bfbc92206cdc34e9d75427394d · otxserver-new/master · GitHub
And we can now see that we have 6 entries in that table, all contain id and the value of id.
So we now know that the table is correct and we call it correctly (local reward ...)

So let's move to the next line, we wanna find lionrock.rewards.X.count.
This is where we have found the problem, count does not exist.
Lua should see this and default it to 1, but as a "hack" let's help it out by doing this;
Lua:
count = reward.count == nil and reward.count or 1

That should fix your problem
 
Malucoo uses Viking's datapack.
I do not find any other better. Do you have any?

But you still havn't posted everything :p
Lua:
local reward = lionrock.rewards[math.random(0, #lionrock.rewards - 1)]
count = reward.count and reward.count or 1

Those are the two lines we need to check.

Lua:
lionrock.rewards
We need to try and find that table and it's here; master/lionrock.lua at b0302167eb5ec4bfbc92206cdc34e9d75427394d · otxserver-new/master · GitHub
And we can now see that we have 6 entries in that table, all contain id and the value of id.
So we now know that the table is correct and we call it correctly (local reward ...)

So let's move to the next line, we wanna find lionrock.rewards.X.count.
This is where we have found the problem, count does not exist.
Lua should see this and default it to 1, but as a "hack" let's help it out by doing this;
Lua:
count = reward.count == nil and reward.count or 1

That should fix your problem

Thanks I'll try here
 
But you still havn't posted everything :p
Lua:
local reward = lionrock.rewards[math.random(0, #lionrock.rewards - 1)]
count = reward.count and reward.count or 1

Those are the two lines we need to check.

Lua:
lionrock.rewards
We need to try and find that table and it's here; master/lionrock.lua at b0302167eb5ec4bfbc92206cdc34e9d75427394d · otxserver-new/master · GitHub
And we can now see that we have 6 entries in that table, all contain id and the value of id.
So we now know that the table is correct and we call it correctly (local reward ...)

So let's move to the next line, we wanna find lionrock.rewards.X.count.
This is where we have found the problem, count does not exist.
Lua should see this and default it to 1, but as a "hack" let's help it out by doing this;
Lua:
count = reward.count == nil and reward.count or 1

That should fix your problem
same error
 
Back
Top