Calvert
Member
I've just successfully made a system where I can type passwords or [access codes] into my screen to make certain actions happen. Now I want to make the access codes random every time the system restarts.
This is a small fraction of the code:
obj_control Step Event:
If the player types in X - C - C, an alarm goes off and access is granted for whatever that may be.
But this X - C - C is hardcoded in, and I'd like it to be a random 3 digit passcode based off of the variables "Z" "C" and "X".
The bottom half of that code is in another object's step event, but that doesn't matter here. If you need more code, let me know.
How would I go about doing this?
This is a small fraction of the code:
obj_control Step Event:
Code:
if key0 = "X" && key1 = "C" && key2 = "C"
{
global.powercode = true;
}
if global.powercode = true
{
if alarm[0] < 1
{
alarm[0]=60
}
}
But this X - C - C is hardcoded in, and I'd like it to be a random 3 digit passcode based off of the variables "Z" "C" and "X".
The bottom half of that code is in another object's step event, but that doesn't matter here. If you need more code, let me know.
How would I go about doing this?