How do I make 50% etc.. change to get object

Get help using Construct 2

Post » Fri Dec 12, 2014 7:16 pm

hi
lets say that my player doesnt have pickaxe so i am using my bare hand to pick some rock.
how do i make it so that if i use bare hand i have 45% change to get ore, but if use pickaxe there is 100% to get ore.
thanks
B
7
S
1
Posts: 16
Reputation: 561

Post » Fri Dec 12, 2014 8:27 pm

heipp123 wrote:hi
lets say that my player doesnt have pickaxe so i am using my bare hand to pick some rock.
how do i make it so that if i use bare hand i have 45% change to get ore, but if use pickaxe there is 100% to get ore.
thanks


there are some example in this forum for the "%", but you can solve this without use the %... (try to search on the forum)

for example, "when a block is broken by hand > set a variableB to : choose("pickgold","nogold","nogold","nogold") "

and make another subevent "if the variable x is "pickgold" take a gold from some variable, if not, do nothing.. you can do with number, generate number...etc..."
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Fri Dec 12, 2014 9:00 pm

heipp123 wrote:hi
lets say that my player doesnt have pickaxe so i am using my bare hand to pick some rock.
how do i make it so that if i use bare hand i have 45% change to get ore, but if use pickaxe there is 100% to get ore.
thanks


system: random 100 < 45?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Dec 13, 2014 2:05 pm

thanks guys.
B
7
S
1
Posts: 16
Reputation: 561


Return to How do I....?

Who is online

Users browsing this forum: hrisnz and 11 guests