Keyboard key to mouse key

Is it possible to make it so if the keyboard key is pressed then the mouse button is being pressed?

VirtualUserService might help:

You mean to check if a key is pressed while another one is?, your question is pretty vague, but if that’s the case UserInputService has a function for that

local InputService=game:GetService("UserInputService")

InputService:IsKeyDown()--This takes an Keycode/UserInputType and returns a boolean

--Use it inside a connection of input began
InputsService.InputBegan:Connect(gameProcessedInput,Keycode)
if Keycode==Enum.Keycode.E and InputService:IsKeyDown(Enum.UserInputType.MouseButton1) then
--Probably mispelled the m1 input, anyways, that will be true if the letter E is pressed and left click is being held
end