How would i make it so when the player press E and R it print "E and R was pressed!"
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(K) if K.KeyCode == Enum.KeyCode.E and Enum.KeyCode.R then print("E and R was pressed !") end end)
There are two ways to do this. One keep track of key presses and second use GetKeysPressed or just check each key using IsKeyDown
As you only have two keys I would use IsKeyDown.
Example:-
local userInpServ = game:GetService('UserInputService') userInpServ.InputBegan:Connect(function(inpObj) if userInpServ:IsKeyDown(Enum.KeyCode.E) and userInpServ:IsKeyDown(Enum.KeyCode.R) then print('E and R pressed') end end)
I hope this helps.