local enabled = true
local function onInputBEGAN(inputObject, gameprocessed)
if inputObject.KeyCode == Enum.KeyCode.E then
print("pressed")
enabled = false
end
end
local function onInputENDED(inputObject, gameprocessed)
if inputObject.KeyCode == Enum.KeyCode.E then
print("released")
enabled = true
end
end
if enabled == true then
game:GetService("UserInputService").InputBegan:connect(onInputBEGAN)
elseif enabled == false then
game:GetService("UserInputService").InputEnded:connect(onInputENDED)
end
The script should print 'pressed' when the 'E' key is pressed and should print 'released' when it's released, but it's not working. There are no errors printed in the output either.
What's wrong with my script? Is there an easier, more efficient way to do this?
Please help.

2 comments
Where is 'Character:FindFirstChild("Kagune")' part?
Sorry forgot to remove that, it's not needed.