Advertisement
fusionfriends

Untitled

May 3rd, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3. local UIS = game:GetService("UserInputService")
  4. local UserInputEvent = script.UserInputEvent
  5. local MousePositionEvent = script.MousePositionEvent
  6. local IsHolding = false
  7.  
  8. UIS.InputBegan:Connect(function(Input)
  9.     if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  10.         IsHolding = true
  11.         UserInputEvent:FireServer(IsHolding)
  12.     end
  13. end)
  14. UIS.InputEnded:Connect(function(Input)
  15.     if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  16.         IsHolding = false
  17.         UserInputEvent:FireServer(IsHolding)
  18.     end
  19. end)
  20. game:GetService("RunService").Heartbeat:Connect(function()
  21.     local MousePosition = Mouse.Hit.p
  22.     MousePositionEvent:FireServer(MousePosition)
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement