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

boss drop

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i have problem with boss drop, i try make math.random two items in boss, but when i add it like that
Code:
local item = math.random(1,5)
local cc = math.random(1,50)
local config = {
    ["Boss"] = {
        loot = {{12686,100,item},{2160,100,cc},{12688,33,1},{10224,20,1}},
        message = "You got reward to your backpack",
        BagId = 9774,
        level = 1
    },

But it only works once per creaturescripts reload, when I reload the script randomizes one number and it drops all the time until the next reload
 
Solution
Put the config and the math.random variables inside the function, that way math.random gets called every time the function gets called.

Code:
local config = {
    ["Boss"] = {
        loot = {{12686,100,math.random(1,5)},{2160,100,math.random(1,50)},{12688,33,1},{10224,20,1}},
        message = "You got reward to your backpack",
        BagId = 9774,
        level = 1
    },

Try this out.
Wont work either
Code:
local config = {
    ["Boss"] = {
        loot = {{12686,100,math.random(1,5)},{2160,100,math.random(1,50)},{12688,33,1},{10224,20,1}},
        message = "You got reward to your backpack",
        BagId = 9774,
        level = 1
    },

Try this out.
 
Put the config and the math.random variables inside the function, that way math.random gets called every time the function gets called.

Code:
local config = {
    ["Boss"] = {
        loot = {{12686,100,math.random(1,5)},{2160,100,math.random(1,50)},{12688,33,1},{10224,20,1}},
        message = "You got reward to your backpack",
        BagId = 9774,
        level = 1
    },

Try this out.
Wont work either
 
Solution
Code:
local config = {
    ["Boss"] = {
        loot = {{12686,100,math.random(1,5)},{2160,100,math.random(1,50)},{12688,33,1},{10224,20,1}},
        message = "You got reward to your backpack",
        BagId = 9774,
        level = 1
    },

Try this out.

Not work i tested it too :p its same like i have but without local variables

Put the config and the math.random variables inside the function, that way math.random gets called every time the function gets called.


Wont work either

Yea, it work thanks
 
Back
Top