You still have it all in the same event set to action button, which is presumably where your shop is.
So it's
still executing all of the randomizing code every time you press for the shop. Just using a variable at the bottom doesn't change anything if you have all of the preceding lines of code still there.
Logically, if you want the randomizing to
not happen every time, you need to separate those things - that's why I told you how to separate them using a game variable. That's like saying "You said I can take a shortcut by taking a left, but I'm still going straight to the traffic light - why isn't my trip shorter?"
😉
So you have one common event or something with all of the code before SceneManager.push() and you insert the saving to the variable that I showed you.
Code:
var list = [list_of_item_ids];
var goods = [];
for(var i=0; i<8; i++){
goods.push([0, list.splice(Math.randomInt(list.length),1), 0]);
}
$gameVariables.setValue(33, goods);
And that randomizes the goods and saves them in a variable.
Then the event you trigger to start the shop just has
Code:
SceneManager.push(Scene_Shop);
SceneManager.prepareNextScene($gameVariables.value(33), true);
And you don't call your randomizing event again until whatever point in your game you want to re-randomize it.