So I am basically writing a script for a player to be able to change the text of a Gui.
I want the player to be able to type, so far I have managed but I can not find a way to basically detect when the player presses Enter or Delete. I know how to program the rest when the button is pressed but when it comes to detecting it I've got no clue.
Here is the part in Global Script, It's connected through a remoteevent to a local script detecting and sending the keys pressed.
keyboards = {"--//%USERNAME:"}
function Type(player, key)
if key == DeleteButton then
mydeletescript()
else
table.insert(keyboards, key)
PGUIFrame.ScrollingFrame.qwerty.Text = table.concat(keyboards, "")
end
script.Parent.Parent.Values.keypress.OnServerEvent:Connect(Type)
Please tell me if there is a detail I forgot to mention!

3 comments
dont use keydown, it's deprecated. User input service instead
Ok, so I was just being plain dumb and using an deprecated service. You can use the User Input Service to get stuff like this and it will work much, much better.
Don't do my mistake!
Enter is Enum.KeyCode.Return, Delete is Enum.KeyCode.Delete