Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService("Players").LocalPlayer
- local mouse = plr:GetMouse()
- local character = plr.Character
- local act=true
- mouse.KeyDown:Connect(function(k)
- if k == "l" then
- act = not act
- print(act)
- end
- end)
- mouse.Button1Down:Connect(function()
- if not act then return end
- curpos=plr.Character.HumanoidRootPart.CFrame
- local target = nil
- count = 1
- curhp = 0
- ne = math.huge
- if math.random(1,10) == 10 then
- for _,v in pairs(game:GetService("Players"):GetPlayers()) do
- if v.Name ~= game:GetService("Players").LocalPlayer.Name then
- if v.Character:FindFirstChild("HumanoidRootPart") then
- targetposition = v.Character:FindFirstChild("HumanoidRootPart").Position
- if (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude < 10 then
- if ne > (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude then
- ne = (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude
- curhp = v.Character:FindFirstChildOfClass("Humanoid").Health
- warn(v.Name,"\nPosition:",targetposition,"\nMagnitude: ",(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude)
- target = v
- else
- print("NE < New NE")
- end
- end
- end
- end
- end
- end
- if target then
- character.HumanoidRootPart.CFrame = target.Character:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(target.Character.Head.CFrame.LookVector)
- character.HumanoidRootPart.Velocity = Vector3.new(character.HumanoidRootPart.Velocity.X,character.HumanoidRootPart.Velocity.Y*-1,character.HumanoidRootPart.Velocity.Z)
- wait()
- if curhp > target.Character:FindFirstChildOfClass("Humanoid").Health then
- character.HumanoidRootPart.CFrame=curpos
- else
- print([[CURHP < target.Character:FindFirstChildOfClass("Humanoid").Healt]])
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement