✓ Accepted answer
http://wiki.roblox.com/index.php?title=File:Ascii_Table.png
Here is a list of the ASCII characters used in Lua, if you look down a bit, you can see that no. 27 is for the escape key.
In order to detect what key was pressed, we need to convert the key (Which is a string) into it's ASCII decimal representation, and then we can check to see if the key is really the escape key.
To convert a string (Ie: "a") into a decimal (65), we use string.byte(string).
Since we know that the ASCII value of the esc key is 27, we can use string.byte to see if they pressed the escape key.
function keyDown(key)
if string.byte(key) == 27 then
script.Parent.Parent.Frame.Visible = true
script.Parent.Visible = false
script.Parent.Parent.Frame.Play.Script.Disabled = false
end
end
1 comment
Thanks!