How to detect a player holding their right mouse button

specifically, I want to make an animation play when you hold the right mouse button

this is my script, I don’t really know how to script properly

if LeftWeapon == Character.Shield then
	UIS.InputBegan:connect(function(input, GPE)
		if input.UserInputType == Enum.UserInputType.MouseButton2 and Attacking == false then
			--Play start animation
			wait(0.1)
			while input.UserInputType == Enum.UserInputType.MouseButton2 and Attacking == false do
				--Play holding animation
			end
			--Play end animation
		end
	end)
end

I’m so sorry i figured it out myself after 1 hour

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.