-- KEY IS UP --

UIS.InputEnded:Connect(function(Input, isTyping)
	if isTyping then return end

	if Input.KeyCode == Enum.KeyCode.R then
		if Holding.Value == "R" then
			isHolding = false
			SkillsHandler:FireServer("R", Mouse:GetHit().Position)
			Animations.R:AdjustSpeed(1)
		end
	end
end)

Holding:GetPropertyChangedSignal("Value"):Connect(function()
	if Holding.Value ~= "None" then
		HumRP.Anchored = true
		isHolding = true
		if Holding.Value == "R" then
			Animations.R:Play()
			Animations.R:GetMarkerReachedSignal("Idle"):Connect(function()
				if isHolding == true then
					Animations.R:AdjustSpeed(0)
				end
			end)

			repeat
				HumRP.CFrame = CFrame.lookAt(HumRP.Position, Mouse:GetHit().Position)
				task.wait()
			until Holding.Value ~= "R"
		end
	else
		HumRP.Anchored = false
	end
end)
