Advertisement
ProScripter29

Naval Warfare Autoaim Improved

Mar 8th, 2025 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. local a = game.Players
  2. local b = a.LocalPlayer
  3. local c = 800-- bullet velocity between 799-800
  4.  
  5. local function d()
  6. local e = b.Character
  7. local f = e and e:FindFirstChild("HumanoidRootPart") and e.HumanoidRootPart.Position
  8. if f then
  9. local g, h = nil, math.huge
  10. for _, i in ipairs(a:GetPlayers()) do
  11. if i ~= b and i.Team ~= b.Team and i.Character and i.Character:FindFirstChild("HumanoidRootPart") then
  12. if i.Character.HumanoidRootPart.Position.Y > -10 then
  13. local j = (i.Character.HumanoidRootPart.Position - f).Magnitude
  14. if j < h then
  15. local k = i.Character:FindFirstChildOfClass("Humanoid")
  16. if k and k.Health > 0 then
  17. h = j
  18. g = i
  19. end
  20. end
  21. end
  22. end
  23. end
  24. return g, h
  25. end
  26. end
  27. local function l(m, n)
  28. if not m then return m end
  29. local o = m.Velocity
  30. return m.Position + (o * n)
  31. end
  32.  
  33. local p = Drawing.new("Line")
  34. p.Visible = false
  35. p.Color = Color3.new(1, 0, 0)
  36. p.Thickness = 1
  37.  
  38. game:GetService("RunService").Heartbeat:Connect(function()
  39. local s, ds = d()
  40. if s then
  41. local t = s.Character:FindFirstChild("HumanoidRootPart")
  42. if t then
  43. local u = b.Character.HumanoidRootPart.Position
  44. local v = l(t, (t.Position - u).Magnitude / c)
  45. p.From = Vector2.new(workspace.CurrentCamera:WorldToViewportPoint(u).X, workspace.CurrentCamera:WorldToViewportPoint(u).Y)
  46. p.To = Vector2.new(workspace.CurrentCamera:WorldToViewportPoint(v).X, workspace.CurrentCamera:WorldToViewportPoint(v).Y)
  47. p.Visible = true
  48. game:GetService("ReplicatedStorage").Event:FireServer("aim", {v})
  49. if ds <= 1500 then
  50. local args = {
  51. [1] = "shoot",
  52. [2] = {
  53. [1] = true
  54. }
  55. }
  56. game:GetService("ReplicatedStorage"):WaitForChild("Event"):FireServer(unpack(args))
  57. end
  58. end
  59. else
  60. p.Visible = false
  61. end
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement