legtoleg Posted June 1, 2020 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 21 Reputation: 0 Joined: 02/11/19 Last Seen: April 4, 2024 Share Posted June 1, 2020 Hello ! I would like to have a npc where we give items and in return we have a 50% chance of having defined items or having nothing at all. For example, you have to give 10 apples to have a 50% chance of having certain items and 50% of having nothing Can you help me ? Thanks Quote Link to comment Share on other sites More sharing options...
0 Start_ Posted June 2, 2020 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 950 Reputation: 181 Joined: 04/05/13 Last Seen: Wednesday at 08:26 AM Share Posted June 2, 2020 .@req_amount = 10; .@req_item_id = 501; if(countitem(.@req_item_id) >= .@req_amount) { delitem .@req_item_id,.@req_amount; if(rand(100) >= 50){ getitem 1599,1; } } Try this. Quote Link to comment Share on other sites More sharing options...
0 Haruka Mayumi Posted June 2, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 485 Reputation: 271 Joined: 06/13/17 Last Seen: May 14 Share Posted June 2, 2020 Quote Link to comment Share on other sites More sharing options...
0 legtoleg Posted June 2, 2020 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 21 Reputation: 0 Joined: 02/11/19 Last Seen: April 4, 2024 Author Share Posted June 2, 2020 Thanks you so much ! it's perfect n fact, i would like them not to choose the item. He click on the pnj, this one checks if has the request items (10 red potion) if he has everything, the npv gives him an item (put in the script list) or nothing 50% chance. Like on chiken ro for the connoisseur (cla machine) Quote Link to comment Share on other sites More sharing options...
Question
legtoleg
Hello !
I would like to have a npc where we give items and in return we have a 50% chance of having defined items or having nothing at all. For example, you have to give 10 apples to have a 50% chance of having certain items and 50% of having nothing
Can you help me ?
Thanks
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.