SuperSolozYT

BIG PAINTBALL KILL ALL

Sep 29th, 2020 (edited)
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. if _G.active == nil then
  2.     _G.active = true
  3. end
  4.  
  5. local plr = game:GetService("Players").LocalPlayer
  6. local round_type = game:GetService("Workspace")["__VARIABLES"].RoundType
  7. local guns_folder = game:GetService("Workspace")["__DEBRIS"].Guns
  8. local RS = game:GetService("RunService")
  9.  
  10. local function getPlayer()
  11.     local char = plr.Character or plr.CharacterAdded:Wait()
  12.     local humr = char:WaitForChild("HumanoidRootPart")
  13.  
  14.     return char, humr
  15. end
  16.  
  17. local function get_target_players()
  18.     local current_guns = guns_folder:GetChildren()
  19.     local target_players = {}
  20.  
  21.         for i,v in next, current_guns do
  22.             local player = game:GetService("Players"):FindFirstChild(v.Name)
  23.  
  24.             if player then
  25.                 if round_type.Value:lower():match("tdm") and player.Team ~= plr.Team then
  26.                     table.insert(target_players, player)
  27.                 elseif round_type.Value:lower():match("ffa") and player.UserId ~= plr.UserId then
  28.                     table.insert(target_players, player)
  29.                 end
  30.             end
  31.         end
  32.  
  33.     return target_players
  34. end
  35.  
  36. while RS.RenderStepped:Wait() and _G.active do
  37.     local targets = get_target_players()
  38.  
  39.     for i,v in next, targets do
  40.         local cam = workspace.CurrentCamera
  41.  
  42.         repeat
  43.             local char, humr = getPlayer()
  44.             local target_char = v.Character if not target_char then break end
  45.             local target_humr = target_char:WaitForChild("HumanoidRootPart")
  46.  
  47.             humr.CFrame = target_humr.CFrame - target_humr.CFrame.lookVector * 5
  48.             cam.CFrame = CFrame.new(cam.CFrame.p, target_humr.Position)
  49.             RS.RenderStepped:Wait()
  50.         until not guns_folder:FindFirstChild(v.Name) or not _G.active
  51.     end
  52. end
Add Comment
Please, Sign In to add comment