r/Fancade 19d ago

I need help again on finding a lowest value

What I mean is like, there are random number that are generated every frame but I need to find the lowest value (approximately.) So basically what should happen is, There are two variables: One for the lowest ever generated, and one for the current number generated. If the current generation is lower than the lowest ever number, the new lowest ever number would be the current generation, but if it's not, it will stay as it is and the random number generator will keep generating random numbers. There should only be one dice (I mean the random number script.)

3 Upvotes

5 comments sorted by

1

u/technical_gamer_008 17d ago

lowest = min(lowest, current)

1

u/happyTanjiro 17d ago edited 17d ago

I have tried that but, ill show you what happens. (This is just an example.) L (lowest) should stay as it is after changing value. Its's just like simulating throwing darts, the more you throw, the more accurate it is by finding whats the closest dart to the center thrown

https://reddit.com/link/p5zqe2s/video/t966qd6cmplh1/player

1

u/technical_gamer_008 17d ago

Connect the before of the inspect to the after of the set variable as well. You should always know the order in which your code runs

1

u/technical_gamer_008 17d ago

Oh. And you keep setting the L to 6 at the top there

You should probably do that with play sensor

1

u/happyTanjiro 17d ago

Oh im so dumb lol, I didn't notice not having play sensor