Quote:
Originally Posted by mongreldogg
no problem.
u can just declare new function
function blablabla()
insert_item(...)
end
in any place in yr lua scripts
and then make sql query
update arcadia.dbo.itemresource
set script_text='blablabla()'
where id= yr item id
easier=)
|
And you have to adjust the item_use_flag, remove the dropgroup from the opt_vars, create a script function that will randomly give one item...yes it's much easier
I think it's easier to use one sql query to adjust the drop group instead of updating item resource + creating a new script function
but if you want to create an existing function new your script should look like this:
function give_out_item()
local itemarray = {itemid1,itemid2,itemid3,itemid4...}
local pointer = math.random(1,itemarraycount)
insert_item(itemarray[pointer],1,0,0,2)
end
But it's easier to modify the dropgroud.