How to make a stock market?

I’m making stock market game cause it sounds cool, but I totally cannot figure out how to actually make the randomizing in the market
it randomizes every like 10-20 seconds but it needs to be able to crash, and skyrocket, or just small fluctuations

In the blocks inside of a device there’s the option to get a random integer

2 Likes

not sure if that helps

1 Like

yes i use this since i made fishing gametoo, i will just play around till it works mbe

Then why did you post ?

6 Likes
  1. Get a lifecycle, repeater, and text device:

  2. Set the lifecycle to game start

  3. Wire this:

  4. Set the repeater to repeat every 15 or so seconds and to transmit on a channel of your choice

  5. Add these blocks in the text using the channel in the repeater

thx to @Papyrus for fixing this
(the whole color part is optional)

Tell me if you have any issues with this or you want me to do anything else

6 Likes

thank you pookie
just joined already cooking

2 Likes

Shouldn’t it be like this? The text will never go over a hundred, so it will always be red… Shouldn’t it be 200 instead of 100? (I don’t know how I did this, I’m horrible at block code…)


EDIT: Thanks for fixing it!

3 Likes

ok this works really well, but on the other hand now I have the problem on how to sell the stock at the price it is…

maybe this game wasn’t a good idea to try to make this game… :sob: :folded_hands:

Okay, but what do you mean by sell the stocks? (I know NOTHING about stocks…)

so im thinking when you buy a stock, it will give you a seed but you need to be able to sell the seed for the given price

I was thinking about something like this, but the way you set it up is actually great! And with the colored text too? Nice!

3 Likes

Uhhh… Can you explain it me as though I don’t know a single thing about stocks? (because i dont know a thing :sob:) What do you mean by buy it at the given price? Like the price shown on the text? What does it mean when it’s negative?

I tried searching the meaning of it but it’s taking a toll on my brain cells that remain… I need a simple (VERY simple) explanation if possible…

1 Like

So, there are blocks in item granters that grant specific amount of item, so connect the amount to a property that connects to the random fluctuation, and connect item grant to button
Also since skyrocket and crash are not likely, you can do this: 1/10 chance for massive change, if not massive change, then the range for cost change would be relatively stable, i.e, from 50%to 150%, if massive change, either 0-50% to 150-200%

2 Likes

The only thing i’m thinking is having the number set to a property, then when they click a button, it checks that property, and if it’s negative, it removes that number of an item, and if it’s positive, it gives that number of an item

1 Like

and thank you for the compliment

2 Likes

next question is how the flip do i make it so that whatever the current stock price is, is what you sell it for at that moment?

and also how do i make the text match the sell price cause propertys dont work or im dum
@pookiezach

Feel like…
R3@P3@T3RS (can’t even say it right) aren’t efficient enough while creating a stock market.
Try a trigger loop/wire repeater loop, like this guide says…

Luv dis guy’s guide. :D

3 Likes

I’ll try to do all this tommorow, and I’ll make a guide

1 Like

I hate them too just never found a good alternative

1 Like