This script function properly until it gets akeypressed = false
Q keeps printing despite releasing the Key "q"
d = game:GetService("UserInputService")
local akeypressed = true
d.InputBegan:Connect(function(input,gameProccesedEvent) local akeypressed = true
if input.KeyCode == Enum.KeyCode.Q then
while akeypressed == true do
wait()
print ("q")
end
end
end)
d.InputEnded:Connect(function(input,gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.Q then
if d.InputEnded then
akeypressed = false
end
end
end)
