It basically detects when the player right-clicks and what I want is for it to detect when he stops pressing it. If you think I should use another command, say so, you probably know more than me.
local UserInputService = game:GetService("UserInputService")
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
-- Checking if event is already processed by an Gui or the ContextActionService
if (gameProcessedEvent) then
return
end
if (input.UserInputType == Enum.UserInputType.MouseButton2) then
-- Code that needs to be run if right mouse button is released
end
end)