Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i make a costume rare
- sussus-_moogus
-
25 posts
how do i make a costume rare
what i mean is https://scratch.mit.edu/projects/607679359/editor/ i need help making unfairness bambi a rare pet
- xarparx
-
100+ posts
how do i make a costume rare
Please share the project, so we can see the problem and find a solution.
This may help:
This may help:
Last edited by xarparx (Nov. 27, 2021 03:52:06)
- Scratch137
-
1000+ posts
how do i make a costume rare
I assume this is the code you're talking about:

The issue with this is that the “pet” sprite only has four costumes. If you attempt to set the costume to any number higher than 4, it will loop back around to 0 and continue counting from there. This means that 5=1, 6=2, and so on.
Instead, you can try creating a new variable to pick a random number. For example:
You can play around with different numbers; for example:
Here's the whole script with this code added:


The issue with this is that the “pet” sprite only has four costumes. If you attempt to set the costume to any number higher than 4, it will loop back around to 0 and continue counting from there. This means that 5=1, 6=2, and so on.
Instead, you can try creating a new variable to pick a random number. For example:
This script gives the “Unfair” costume a 10% chance to appear, while all the other costumes have a 30% chance.
You can play around with different numbers; for example:
This gives the “Unfair” costume a 1% chance to appear, while all the other costumes have a 33% chance.
Here's the whole script with this code added:

Last edited by Scratch137 (Nov. 27, 2021 06:00:55)
- Discussion Forums
- » Help with Scripts
-
» how do i make a costume rare