Ok, so there is a lottery machine in Farmchain. I didn’t find a guide so here goes.
First
So let’s have a history lesson here. In Farmchain, the more time goes on, the more money you get. So obviously, we want that too. Well, i hope so at least. For this guide, you will need the following:
1 vending machine
1 repeater*
1 counter
1 item grater
1 property
2 lifecycles
*- I will be using a repeater for the pictures in the guide. But 2 trigger clocks will work just fine. Possibly a wire repeater clock too, i think. Don’t know much about that one. But feel free to use a trigger clock. If you don’t know what I am talking about, go to this guide by @WhoAmI Short Guide: A guide to your types of repeaters ( 🟩)
Second
Let’s configure the vending machine. Look at the screenshot below:
This was done so a broadcast would get to our item granter. Now you can do a different icon. Like icons/Multiply Cash or icons/Add Cash.
Third
Now let’s configure the item granter. Like so:
Now we need to do something that might be a little difficult for newer gims. If that is you, then hopefully you’ll learn something along the way. Look at these blocks:
Don’t freak out! Lets go over this together. We have a property, which i named lotteryproperty. The if/else if blocks are just seeing what that property is equal to. If you don’t know where to find it, go to the logic tab and click the gear icon to add the else if/else blocks. The grant custom amount item blocks are in the for this device section. They are giving the cash that comes out of the vending machine. Well, actually behind the scenes it is the item granter, but your friends won’t even know. The random interger and numbers are found in the math section. this just chooses how much money to give you, randomized between the two intergers. Make sense now? Good. Also, you can find the get property block under the essentials tab.
Fourth
Let’s configure the property device now.
There is a reason for all of this. Make sure it is a number. I will explain the reason for it being player scope later. Let’s move on.
Fifth
Let’s configure the counter now.
This will all be used when our repeater runs its task. The player scope is mandatory.
Sixth
Let’s configure the repeaters now.
Now copy that repeater. You can do this by hovering over your existing repeater and pressing C. Make another trigger clock if you are doing that. Now edit it by clicking on it and changing the ‘start repeater when receiving’ to something like latejoin.
Seventh
Time to configure our lifecycles. Like this:
And one like this:
This is to start the repeaters.
Eight
Now for the easy part. Wires! (Or channels but newer gims should use wires.) Wire the repeaters to the counter. Both should have this setting:
Now this should all work! Probably an easier and better way!
- 0/10 or
- 1/10 or
- 2/10 or
- 3/10 or
- 4/10 or
- 5/10 or
- 6/10 or
- 7/10 or
- 8/10 or
- 9/10 or
- 10/10 or
- 11/10 or /
0 voters
As always, this is @Here_to_help, Happy Gimkitting!