Script runs when mouse button 1 or 2 is clicked?
Id like to make it so it only works when left click (button 1) is clicked, thanks in advance!
02 | local ding = game.Workspace.Sounds.Ding |
03 | local part = game.Workspace.Configuration.DesertScout 1 |
04 | local player = game.Players.LocalPlayer |
05 | local mouse = player:GetMouse() |
06 | local UserInputService = game:GetService( "UserInputService" ) |
07 | local PlayerGui = player:WaitForChild( "PlayerGui" ) |
08 | local toolup = PlayerGui:WaitForChild( "clickE" ) |
10 | local gui = PlayerGui.HatUI.DesertScoutAdd |
14 | UserInputService.InputBegan:Connect( function (input,gameProccesedEvent) |
16 | local item = mouse.Target |
17 | local distance = player:DistanceFromCharacter(item.Position) |
18 | if mouse.Target = = part and enabled = = true and distance < = maxpickup and mouse.Button 1 Down then |
21 | part.Position = Vector 3. new( 100 , 100 , 100 ) |
25 | part.CanCollide = false |
27 | game.ReplicatedStorage.HatEvent.DesertScoutEvent:FireServer() |
33 | part.CanCollide = true |