What I would like to do is so if I'm holding the "E" key down, it will allow me to print "hello" if I click. It doesn't work at all.
-- Variables local plr = game:GetService("Players").LocalPlayer local uis = game:GetService("UserInputService") -- Main function uis.InputBegan:Connect(function(input, gameProcessedEvent) if input.UserInputType == Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.E then if input.UserInputType == Enum.UserInputType.MouseButton1 then print("hello") end end end end)
Well, I think you can use Mouse
from Player
instance for mouse combo:
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local UIS = game:GetService("UserInputService") local isHeld = false Mouse.Button1Down:Connect(function() isHeld = true end) UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.E then if isHeld == true then print("e") end end end)