The forums will be going offline for an extended maintenance period at 1400hrs GMT on 19th June 2025. The number of hours for this downtime is intentionally not advertised due to the nature of these upgrades.
×
- 0
get item with percentage!
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
Chasewalk
Good day everyone, i'm requesting for a npc script how to put in the script for example when they pay 5k zeny is 5% to chance get item, but when 5m zeny 10% chance they getitem. sorry for may bad english!!
PS: 5,000 zeny is 5% chance and 5M zeny is 10% chance
~Thanks.
input .@zeny_to_gamble;
Edited by Chasewalkif (.@zeny_to_gamble == 0) {
mes "You can only put ^FF00005,000^000000 up to ^FF00005,000,000^000000 Zeny to proceed.";
close;
}
if (.@zeny_to_gamble < 5000 || .@zeny_to_gamble > 5000000) {
mes "You can only put ^FF00005,000^000000 up to ^FF00005,000,000^000000 Zeny to proceed.";
close;
}
Zeny -= .@zeny_to_gamble;
.@r = rand(100);
if (.@r < (.@zeny_to_gamble/100000)) { // 50/100 = 50% chance
Link to comment
Share on other sites
1 answer 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.