Random Event

Hello im new to RPG Maker and don't have much expirience.
so im working on a little project right now and i want to do it so like when you talk to an object it shows an picture but in like a 1 to 100 chance it shows a different picture how would i be able to do that?
variable x = random.... 0-99
if variable x = 0
show picture 1 (ID 1)
end
if variable x = 1
show picture 2 (ID 1)
end

and continue the list for all 100 possibility pictures, use constant ID 1
so you can erase ID 1 easier, and use a selfswitch if need.
variable x = random.... 0-99
if variable x = 0
show picture 1 (ID 1)
end
if variable x = 1
show picture 2 (ID 1)
end

and continue the list for all 100 possibility pictures, use constant ID 1
so you can erase ID 1 easier, and use a selfswitch if need.
Thank you ^^
If you have a ton of possible pictures to show, do as the above poster said but instead of using the the show picture command use this script call instead.
JavaScript:
$gameScreen.showPicture(1, $gameVariables.value(x), 1, 96, 144, 100, 100, 255, 0);
Replace x with the id of your variable and name your pictures: 1, 2, 3, ect..
This will save you from having to make a zillion show picture commands.
@Rugman that is something i didn't know, but if that is true, to name
pictures, 0, 1, 2, 3.... 100, it's indeed way easier, but the conditional
branch can hold this part too? if so, it's way shorter and sweeter 🙂
Yes you could use it in a conditional branch. I use it in this monster storage box event I made.
very impressive, I love it, keep up the nice work 🙂

Original thread: https://forums.rpgmakerweb.com/threads/random-event.134608/