How Do I Make A Lottery System For My Game

I am working on a game called “Banana Wars” and I’ve been making decently good progress on it. I found a tutorial on how to do the lottery system but it didn’t work. Any ideas? Here’s what I have:
1 Vending Machine Wired to a Item Granter.
It Says “When Purchased, Run Wire Pulse Block.”
The Vending Machine Requires a Lottery Ticket and is set to transmit on channel.
Here is the Blocks I Used For The Item Granter:


I Don’t Really Know What to Do, so if I can’t figure it out I’ll just delete it. Please Help if You Can!

Sounds like you could use loot tables…
Here:

Welcome to the forum MAKISBESTER!!!
I hope you have a good time here

2 Likes

Thanks! I probably will.

Welcome to the forums, @MAKISBESTER !!!

How could I do This With a Vending Machine Though, so That They Have To Spend a Lottery Ticket?

Why is the cash property used? Since you want to update it wouldn’t you want to put set cash variable and then update the property?

You CAN use the above guide for the item granter I’m pretty sure.

I was following a tutorial, if you search up “How to make a Lottery System in Gimkit” The First Thing that Popped up was what I used. Im kinda new, so I don’t really know how properties work.

Properties store data to use in blocks. They are like better variables.

Thank you, the forums seem to be very helpful.

OH! So like variables in JavaScript?

1 Like

variables in any type of code. JS, blocks, python, you name it! use the loot tables guide but instead of a button use a vending machine.

Ok, that makes sense. Thank you for your help! I’ll mark that as the solution if it works.

1 Like

Lol I thought you had caps lock on (No offence MAKISBESTER )

I’m too late to the party :neutral_face:

1 Like

Lolz, my name is meant to be in all caps.

Hold on, for this do i do grant item when receiving on said loottable channel?

No it’s mak is bester, but yes to the second question.

1 Like

Yes that should be correct. item purchased through vending machine, broadcast on channel “loottable” mb

You can’t do that… I mean, how do you set a property that is a variable…??