First if statement works, not the second.
local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer local mouse = player:GetMouse() uis.InputBegan:Connect(function(Start,End) if mouse.Button2Down then print("mouse.Button2Down worked") elseif mouse.Button2Up then print("mouse.Button2Up worked") end end)
This is because UserInputService is not the same as Mouse, the way I would do this is like this:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button2Down:Connect(function() -- function fires when your right mouse button is clicked down print("mouse.Button2Down worked") end) mouse.Button2Up:Connect(function() -- function fires when your right mouse button is released print("mouse.Button2Up worked") end)