XScriptGiverX

Arsenal Backstab

Jun 27th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. local localplayer = game.Players.LocalPlayer
  2. local currentcamera = workspace.CurrentCamera
  3. --local virtualUser = game:GetService("VirtualUser")
  4.  
  5. local function teleportBehindTarget(player)
  6. localplayer.Character.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame + player.Character.HumanoidRootPart.CFrame.lookVector * -4
  7. end
  8.  
  9. local function getRandomEnemyPlayer()
  10. local list = {}
  11. for i, player in pairs(game.Players:GetPlayers()) do
  12. if player.TeamColor ~= localplayer.TeamColor then
  13. table.insert(list, 1, player)
  14. end
  15. end
  16. return list[math.random(1,#list)]
  17. end
  18.  
  19. while wait(0.3) do
  20. local enemy = getRandomEnemyPlayer()
  21. for i = 1,10 do
  22. if not enemy.Character:FindFirstChild("HumanoidRootPart") then break end
  23. if enemy == nil then break end
  24. teleportBehindTarget(enemy)
  25. wait()
  26. currentcamera.CFrame = CFrame.new(currentcamera.CFrame.p, enemy.Character.HumanoidRootPart.Position)
  27. --virtualUser:ClickButton1(Vector2.new(0,0))
  28. end
  29. end
Add Comment
Please, Sign In to add comment