I was running a simple piece of code and i came upon a error, outputs not giving me anything
local UserInputService = game:GetService("UserInputService")
local aKeyPressed = false
UserInputService.InputBegan:Connect(function(input, gameProccesed)
if input.KeyCode == Enum.KeyCode.A then
aKeyPressed = true
while aKeyPressed == true do
wait()
print("A Key is being held")
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProccesed)
if input.KeyCode == Enum.KeyCode.A then
aKeyPressed = false
end
end)

7 comments
still doesnt work
Sorry i forgot the ".KeyCode" I have edited it
how do you edit it
theres an edit button..
i just realised it wasnt in a local script
Bruh
my bad