local FPSAdorn = require(script:WaitForChild("FPSAdorn"))
local CAS = game:GetService("ContextActionService")
local kc = Enum.KeyCode
local down = {}
local function a(_, state, obj)
if state == Enum.UserInputState.Begin then
down[obj.KeyCode] = true
else
down[obj.KeyCode] = nil
end
--check if any keys are down, if not disable bob
if down[kc.W] or down[kc.S] or down[kc.A] or down[kc.D] then
FPSAdorn:ToggleBob(true)
else
FPSAdorn:ToggleBob(false)
end
end
CAS:BindAction(
"ToggleBob",
a,
false,
kc.W,kc.A,kc.S,kc.D, kc.Y
)
print(CAS:GetBoundActionInfo("ToggleBob"))
It executes if I bind to to a mouse input, but not a key.
