Advertisement
AperexScripts

Roblox Big Paintball OP Script (Working 2023)

Apr 9th, 2023
4,645
1
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 1 0
  1. Roblox Big Paintball OP Script (Unpatched 2023)
  2. --Made by AperexScripts
  3. --This script is fully tested, and is unpatched as of April 2023.
  4.  
  5. --Script
  6.  
  7. local players = game:GetService('Players')
  8. local RunService = game:GetService('RunService')
  9. local Teams = game:GetService('Teams')
  10. local user_input_service = game:GetService('UserInputService')
  11. local workspace = game:GetService('Workspace')
  12.  
  13. local camera = workspace.CurrentCamera
  14. local wtvp = camera.WorldToViewportPoint
  15. local localplayer = players.LocalPlayer
  16.  
  17. local function indexExists(object, index)
  18. local _, value = pcall(function() return object[index] end)
  19. return value
  20. end
  21.  
  22. local function get_character(player) return indexExists(player, 'Character') end
  23.  
  24. local function get_mouse_location() return user_input_service:GetMouseLocation() end
  25.  
  26. local function is_alive(player) return player.Character and player.Character:FindFirstChild('Humanoid') and player.Character:FindFirstChild('Humanoid').Health > 0 end
  27. local function is_team(player) return #Teams:GetChildren() > 0 and player.Team == localplayer.Team end
  28.  
  29. local function getClosestPlayerToCursor(fov)
  30.  
  31. local maxDistance = fov or math.huge
  32.  
  33. local closestPlayer = nil
  34. local closestPlayerDistance = math.huge
  35.  
  36. for _, player in pairs(players:GetPlayers()) do
  37.  
  38. if player ~= localplayer and not is_team(player) and get_character(player) and is_alive(player) then
  39. local pos, on_screen = wtvp(camera, get_character(player).Head.Position)
  40.  
  41. if not on_screen then continue end
  42.  
  43. local distance = (get_mouse_location() - Vector2.new(pos.X, pos.Y)).magnitude
  44.  
  45. if distance <= maxDistance and distance < closestPlayerDistance then
  46. closestPlayer = player
  47. closestPlayerDistance = distance
  48. end
  49. end
  50. end
  51.  
  52. return closestPlayer
  53. end
  54.  
  55. shared.fov = 400
  56. local circle = Drawing.new('Circle')
  57. circle.Thickness = 2
  58. circle.NumSides = 12
  59. circle.Radius = shared.fov or 400
  60. circle.Filled = false
  61. circle.Transparency = 1
  62. circle.Color = Color3.new(1, 0, 0.384313)
  63. circle.Visible = true
  64. local target = nil
  65. RunService.Heartbeat:Connect(function(deltaTime)
  66. task.wait(deltaTime ^ 2)
  67. target = getClosestPlayerToCursor(shared.fov)
  68. circle.Position = get_mouse_location()
  69. end)
  70.  
  71. local OldNamecall
  72. OldNamecall = hookmetamethod(workspace, '__namecall', newcclosure(function(...)
  73. local args = { ... }
  74. local method = string.lower(getnamecallmethod())
  75. local caller = getcallingscript()
  76. if method == 'findpartonraywithwhitelist' and tostring(caller) == 'First Person Controller' then
  77.  
  78. local HitPart = target and target.Character and target.Character.Head or nil
  79. if HitPart then
  80. local Origin = HitPart.Position + Vector3.new(0, 5, 0)
  81. local Direction = (HitPart.Position - Origin)
  82. args[2] = Ray.new(Origin, Direction)
  83.  
  84. return OldNamecall(unpack(args))
  85. else
  86. return OldNamecall(...)
  87. end
  88. end
  89. return OldNamecall(...)
  90. end))
  91.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement