Jump to content

Recommended Posts

  • Management

Hello

I'm trying to set up the automatic OX Event, but I want to change some things (I'm using HaveBeen's quest), one of the things is the automatic prize giver, I want to set up a table (already has) but with percentages, I mean, like the monsters drop, it gives the item based on the percentage of getting it.

				local itemlist = {11299,11499,11699,11899}
				game.drop_item(itemlist[number(1,table.getn(itemlist))],1)

This is what I already have.

Thank you in advance

raw

raw

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Management
13 hours ago, Root said:

u can use number function soi give u example.


local chance = number(1, 100)

if chance <=20 then

game.drop_item(11,1)

elseif chance >= 21 and chance <= 40 then

game.drop_item(19,1)

end

so the bigger u make the chance the harder will drop for ex number (1,1000)
 


if chance <=900 then

game.drop_item(19,1)

end

I managed to use a function on GFquestlib.lua:

				local settings = oxevents.set_settings()
				local reward = get_random_vnum_from_table(settings.premio)
				oxevent.give_item(reward,1)

----------------------------------------------------------------------------------------------------------

Now I've another question, how can I start the event at a specified hour? Like, cronjob, everyday at the same hour.

I have the boot event (got it from vanilla source, I don't know if it useful for this situation)

Thanks

raw

raw

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.