How to make a Keydown and if you let go of the key it makes the script disable

I know this is a bit brute force. But I have a script inside workspace.P1 that c-frames, and the script im sharing is inside starterplayerscripts. How do I make this script enabled while a key is being held down and disabled when it is let go of?

if isTyping then return end

if UIS:IsKeyDown(Enum.KeyCode.D) then
	workspace.P1.Torso.Script.Disabled=false
end
UIS.InputEnded:Connect(function() 
	workspace.P1.Torso.Script.Disabled=true
end)

instead, it only flickers the script on for 0.0001 seconds when D is pressed and not when held.
NOTE: Never mind I fixed it!

I’ll shut this down, I found the solution! Just had to put in a loop :happy1:
(note: I cant shut this down OOF)

I suggest reverting the topic so that others who have the same issue can find an answer quickly.