Management Karbust 4927 Posted July 31, 2017 Management Share Posted July 31, 2017 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 Link to comment Share on other sites More sharing options...
Root 61 Posted July 31, 2017 Share Posted July 31, 2017 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 Link to comment Share on other sites More sharing options...
Management Karbust 4927 Posted July 31, 2017 Author Management Share Posted July 31, 2017 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 Link to comment Share on other sites More sharing options...
Root 61 Posted August 1, 2017 Share Posted August 1, 2017 use the example from nottice quest. Try use that is using server timer. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now