How to tell when the player presses E on the keyboard

Hello, I’m on a laptop and I can’t rotate the camera using right click with the thumbpad. What my plan is, is that I’m going to reprogram roblox’s movement system to let me rotate the camera with the arrow keys and move up/down/left/right with WASD. I know that

local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(Function())
end)

detects for inputs by the local player, but how do I recieve inputs from the roblox studio dev in a plugin?

1 Like

Something like this should work.
Create an invisible frame that covers the entire screen, and put this code in the plugin script

Frame.InputBegan:Connect(function(Input)
	if Input.KeyCode == KEY then
		--do code here
	end
end)

Basically does the same thing with UserInputService but with a frame.

1 Like

Why do you need a frame that covers the entire screen?

A frame can only listen to inputs when the mouse cursor is in it. So a frame that is as big as the screen size can pick up inputs wherever the cursor is.

But he wants to detect if a player click the E key.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.