Advertisement
kaankzdl34

Untitled

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