Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Smallest number in variable list.
- greenlanddeath
- Scratcher
2 posts
Smallest number in variable list.
Im trying to make an ai that duplicates rotates and moves. After 5 seconds it adds the clones distance to player to a variable list, there's around 295 variables in the list after. I want to be able to keep the clone which sent the lowest number (which is the closest to player) and delete the other clones. Any help? Thanks.
- Cool_Dude2022
- Scratcher
100+ posts
Smallest number in variable list.
Here is a very simple demonstration of how to find the smallest number in a list. It happens almost instantly and shouldn't add any lag to your game.
https://scratch.mit.edu/projects/1008908032/
https://scratch.mit.edu/projects/1008908032/
Did I help you fix your problem? If so, please nominate my project to be featured!
If my code is used, credit is NOT required
- Cool_Dude2022
- Scratcher
100+ posts
Smallest number in variable list.
I just realised that I created a project similar to what you are requesting. This detects and points to the closest clone and might be able to help you: https://scratch.mit.edu/projects/964418154/
Did I help you fix your problem? If so, please nominate my project to be featured!
If my code is used, credit is NOT required
- greenlanddeath
- Scratcher
2 posts
Smallest number in variable list.
Thank you! It worked. I will credit you in the desc.
- Discussion Forums
- » Help with Scripts
- » Smallest number in variable list.