local Mouse = game.Players.LocalPlayer:GetMouse() bin = script.Parent
Mouse.KeyDown:connect(function(Key) if Key:lower() == "enter" then bin:CaptureFocus() end end)
-- I know I have this wrong but I'm not sure how to make it so when u press enter it will capture focus Help!?!?
There isn't really a way to check if a player pressed the enter button according to this chart. You could also do
string.byte(key) == 27 then --27 is the escape key on the keyboard.
But you can't really do an enter key.
EDIT
I just learned what Device Control is. The code for enter is 13.
string.byte(key) == 13 then --13 is the enter key on the keyboard.
I don't know about what Lord said, but im pretty sure you can use the enter key. Do it like this and it will work
Mouse.KeyDown:connect(function(Key) if Key:byte() == 13 then bin:CaptureFocus() end end)
Some keys dont have a string value, which is what :lower() if for. You can use :byte() for the number, so for this example, 13 = enter.
Good luck with it!