"Charge" Animation to go with proximity prompt

So I am trying to make a lever that slowly moves down when you hold E on it. When you let go of E it quickly goes back up. But while trying to make this I encountered a problem. When the proximity prompt is finished it runs ProximityPrompt.Triggered and ProximityPromt.PromptButtonHoldEnded. How do I solve this so that .PromptButtonHoldEnded does not run when the proximityprompt was successfully used?

Code:


script.Parent.Triggered:Connect(function(Player)
	if PowerController:RequestPower() ~= 0 and PoweringOn == true and PowerOn == true then --sanity check
		Player:Kick('\nsus')
	elseif PowerController:RequestPower() == 0 and PoweringOn == false and PowerOn == false then
		PowerController:ReactivatePower()
		script.Parent.Enabled = false
		PowerOn = true
	end
end)


script.Parent.PromptButtonHoldBegan:Connect(function()
	local Throwawayval = 1
	PoweringOn = true
	PowerController:ReactivatePower()
	while wait(1) do
		if PoweringOn == false then break end
		Throwawayval = Throwawayval + 1
		if Throwawayval >= 30 then PoweringOn = false PoweringOn = true break end
	end
end)

script.Parent.PromptButtonHoldEnded:Connect(function(Player)
	if PoweringOn == true then
		PoweringOn = false
		script.Parent.Enabled = false
		turnofftween:Play()
		local PoweredDown = PowerController:StopReactivatingPower()
		if PoweredDown == true then
			script.Parent.Enabled = true
		end
	end
end)

(Please ignore the messy and unoptimized code as I haven’t cleaned up the code yet)