When you hold right mouse button you scope in with a gun I only know how to do that with a key, but how to do it with mouse?
01 | Player = game.Players.LocalPlayer |
02 | mouse = Player:GetMouse() |
03 |
04 | if mouse then |
05 | mouse.KeyDown:connect( function (key) |
06 | if key = = "c" then |
07 |
08 | print ( "Test" ) |
09 |
10 | end |
11 | end ) |
12 | end |
Here see if this works
1 | UserInputService.InputBegan:Connect( function (Input) |
2 | if Input.UserInputType = = Enum.UserInputType.MouseButton 1 then |
3 | -- mouse |
4 | elseif Input.UserInputType = = Enum.KeyCode.ButtonR 2 then |
5 | -- R2 |
6 | end |
7 | end ) |