How to tell if a player is holding a key

I need help detecting if a player is holding a key

I’ve looked all over the ContextActionService API but I couldn’t find anything

Heres what I have so far

local ContextActionService = game:GetService("ContextActionService")

local function foo()

print("e")

end

ContextActionService:BindAction("Test", foo, true, Enum.KeyCode.E)

Are you looking for holding a key? or pressed a key once?

https://developer.roblox.com/en-us/api-reference/function/UserInputService/IsKeyDown

5 Likes