simes007us
Member
Hi Everyone,
I'm having a problem with a script I wrote. It checks how big a ds_list that is in an object (loot) and picks a irandom value in the range. 0-ds_list_size
The ds_list in "loot" contains objects. Once the number value is picked it's supposed to create the item in the ds_list with that number.
This produces an error saying that "item" is of incorrect type. The type being "undefined". And I have no idea why. Any suggestions?
I'm having a problem with a script I wrote. It checks how big a ds_list that is in an object (loot) and picks a irandom value in the range. 0-ds_list_size
The ds_list in "loot" contains objects. Once the number value is picked it's supposed to create the item in the ds_list with that number.
Code:
/// @param playerilvl
var playerilvl = argument0
var item = irandom(ds_list_size(loot.lootlist))
var lootlvl = irandom_range(playerilvl-2,round(playerilvl*1.4))
if (lootlvl <=0)
lootlvl = 1
drop = instance_create_depth(x,y,-5,loot.lootlist[| item])
drop.rank = lootlvl