local keyDictionary = {
	["Q"] = false ,
	["E"] = false ,
	["R"] = false ,
    ["F"] = false ,
	["D"] = false ,
	["S"] = false ,
	["H"] = false ,
    ["N"] = false ,
	["Y"] = false ,
	["U"] = false ,
	["L"] = false
}

I tried using print(math.random(keyDictionary)), but it just gave me another error i don't even know about. If anyone can help, please do because I've been stuck on this for quite a long while :)

What i'm trying to do :

I have a script that when you press the T key, you enter a Training Mode, and so i want it to pick a random key from the keyDictionary and print it, or put the selected random Key into a variable called pressThis

4 comments

0

Are you trying to return the key (ex: "Q") or the value (ex: true/false)? Also, why not just use a table?

0

*print

0

Im trying to make it pick a random key like (ex: "Q") as you said and change it to true when chosen

0

And im not really used to using tables, someone told me to use a keyDictionary