Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local UserInputEvent = script.UserInputEvent
- local MousePositionEvent = script.MousePositionEvent
- local IsHolding = false
- UIS.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- IsHolding = true
- UserInputEvent:FireServer(IsHolding)
- end
- end)
- UIS.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- IsHolding = false
- UserInputEvent:FireServer(IsHolding)
- end
- end)
- game:GetService("RunService").Heartbeat:Connect(function()
- local MousePosition = Mouse.Hit.p
- MousePositionEvent:FireServer(MousePosition)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement