How to make a randomized chance to obtain an item

What you will need

x1 Marble Sign
x1 Item Spawner
Optional: x1 Text (That describes what your item is)
Button
Trigger
A few sentries

First of all, Set up your marble sign and item spawner like dis:
Basically, just get a marble sign, put the item spawner underneath it, then move the item spawner to the above layer.
Screenshot 2023-11-28 7.41.39 AM

Then, place a button under it. Make it say something like “Steal”. Now, grab a trigger and wire it to the button.
Screenshot 2023-11-28 7.43.00 AM


Then, put this block code in the trigger’s “When Triggered” Part.
Screenshot 2023-11-28 7.44.52 AM
The red blocks are from the variables section, you make your own variable. Everything else is from the logic, math, essentials, and texts section. The green is text, the random integer part is math, the “Broadcast Message on Channel” is from the Essentials part, the if, do part is from the logic, and yeah.
Now, grab two sentries. Make them both not active on game start. Make them activate when receiving on “Guards attack”, my first channel.
Then, grab an item granter. Make it grant the item when receiving on, “Success!”. And also, make the item you put in the item granter the same as the item you put in the item spawner.
And now you’re done!

Difficulty?
  • 0/10
  • 1/10
  • 2/10
  • 3/10
  • 4/10
  • 5/10
  • 6/10
  • 7/10
  • 8/10
  • 9/10
  • 10/10
0 voters
3 Likes

Nice Guide!

Also, the title seems to general, you can make it like “How to make a randomized chance to obtain an item” or something.

Ok

Nice, the block coding may be a little confusing for new gims, maybe you can put pictures on how to get to the block coding interface.

1 Like

I’ll do it right now

Nice guide, @BreathTaking!

I don’t like York Chocolate @BreathTaking

2 Likes

Cool guide!

1 Like