Advertisement
IDKDONTCALLMEOOF

BI Gpaintball{ROBLOX}

Jan 4th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 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.         repeat

  42.             local char, humr = getPlayer()

  43.             local target_char = v.Character if not target_char then break end

  44.             local target_humr = target_char:WaitForChild("HumanoidRootPart")

  45.  

  46.             humr.CFrame = target_humr.CFrame - target_humr.CFrame.lookVector * 5

  47.             cam.CFrame = CFrame.new(cam.CFrame.p, target_humr.Position)

  48.             RS.RenderStepped:Wait()

  49.         until not guns_folder:FindFirstChild(v.Name) or not _G.active

  50.     end

  51. end

Advertisement
Add Comment
Please, Sign In to add comment
Advertisement