Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer
- local mouse = player:GetMouse()
- local KeyDownRemote = script.Parent:WaitForChild("KeyDown")
- local KeyUpRemote = script.Parent:WaitForChild("KeyUp")
- local Button1DownRemote = script.Parent:WaitForChild("Button1Down")
- local Button1UpRemote = script.Parent:WaitForChild("Button1Up")
- local MoveRemote = script.Parent:WaitForChild("Move")
- local HitRemote,TargetRemote = script.Parent:WaitForChild("Hit"),script.Parent:WaitForChild("Target")
- mouse.KeyDown:Connect(function(k)KeyDownRemote:FireServer(k)end)
- mouse.KeyUp:Connect(function(k)KeyUpRemote:FireServer(k)end)
- mouse.Button1Down:Connect(function(k)KeyDownRemote:FireServer(k)end)
- mouse.Button1Up:Connect(function(k)KeyUpRemote:FireServer(k)end)
- mouse.Move:Connect(function()MoveRemote:FireServer()end)
- local old={Hit=mouse.Hit,Target=mouse.Target}
- game:GetService("RunService"):BindToRenderStep("CHECKING MOUSE HIT AND TARGET",101,function()
- coroutine.resume(coroutine.create(function()
- if mouse["Hit"] ~= old["Hit"] then
- old["Hit"] = mouse.Hit
- HitRemote:FireServer(mouse.Hit)
- end
- end))
- coroutine.resume(coroutine.create(function()
- if mouse["Target"]~= old["Target"] then
- old["Target"]=mouse.Target
- TargetRemote:FireServer(mouse.Target)
- end
- end))
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement