Hokay, let's see here...
There are nine controls total (4 directional, jump, action, switch, bomb, and rope) not including purchase.
So let's create a temporary variable to hold on to each of the controls' actual values. But to make things easier later on, we'll put them in a list. We'll call it...
keyActual = ds_list_create();
ds_list_add(keyActual, global.keyUpVal);
ds_list_add(keyActual, global.keyDownVal);
etc.
Let's also make another list for randomly assigning each key its new value. It'll be the exact same as the previous list, at least for now:
keyUsed = ds_list_create();
ds_list_add(keyUsed, global.keyUpVal);
ds_list_add(keyUsed, global.keyDownVal);
etc.
Now to make each control randomized, we'll shuffle the second list (yay for GameMaker's built in methods!):
ds_list_shuffle(keyUsed);
Now to assign our new values, we'll set up a for loop:
for(i=0; i<=8; i+=1)
{
global.keyUpVal = ds_list_find_value(keyUsed, i);
}
Obviously, all declarations, should go in the create event, and the shuffle and loop should go where the potion is being drunk.
To put everything back to normal, just use:
for(i=0; i<=8; i+=1)
{
global.keyUpVal = ds_list_find_value(keyActual, i);
}
Give this a shot and tell me if you have any trouble.