Advertisement
Vzurxy

VPF ESP RBX Script

Jan 27th, 2019
710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.68 KB | None | 0 0
  1. _G.AccessoryRemove = false
  2.  
  3. --[[ Turn _G.AccessoryRemove to true if you see accessory glitches with you, or another. ]] --
  4.  
  5. local ViewPortGUI = Instance.new("ScreenGui", game.CoreGui)
  6. local Viewport = Instance.new("ViewportFrame", ViewPortGUI)
  7.  
  8. local Players = game:GetService("Players")
  9.  
  10. Viewport.CurrentCamera = workspace.CurrentCamera
  11.  
  12. Viewport.Position = UDim2.new(0, 0, 0, -35)
  13. Viewport.Size = UDim2.new(1, 0, 1, 35)
  14. Viewport.BackgroundTransparency = 1
  15.  
  16. -- Set up arrays to keep track of players who has been put into the VPF frame.
  17.  
  18. local ReplicateList = {}
  19. local CloneList = {}
  20.  
  21. -- Fundamental Parts of VPF Esp.
  22.  
  23. local function AddPlayer(Player)
  24.     if Player ~= Players.LocalPlayer then
  25.         repeat wait() until Player.Character ~= nil
  26.         local Character = Player.Character
  27.         Character.Archivable = true
  28.         local Clone = Character:Clone()
  29.         CloneList[Player] = Clone
  30.         Character.Archivable = false
  31.         Clone.Parent = Viewport
  32.         Clone.Name = ""
  33.         for i,v in pairs(Character:GetChildren()) do
  34.             if _G.AccessoryRemove then
  35.                 if v:IsA("Accessory") then
  36.                     v:Destroy()
  37.                 end
  38.             end
  39.             if v:IsA("BasePart") then
  40.                 ReplicateList[v] = Clone[v.Name]
  41.             elseif v.ClassName == "Humanoid" then
  42.                 ReplicateList[v] = Clone[v.Name]
  43.             end
  44.         end
  45.     end
  46. end
  47.  
  48. local function RemovePlayer(Player)
  49.     for i,v in pairs(Player:GetChildren()) do
  50.         if ReplicateList[v] then ReplicateList[v] = nil end
  51.     end
  52.     if CloneList[Player] then
  53.         CloneList[Player]:Destroy()
  54.     end
  55. end
  56.  
  57. Players.LocalPlayer.DevCameraOcclusionMode = "Invisicam"
  58.  
  59. local function InitPlayer(Player)
  60.     AddPlayer(Player)
  61.     Player.CharacterAdded:Connect(function(Character)
  62.         AddPlayer(Player)
  63.     end)
  64.     Player.CharacterRemoving:Connect(function(Character)
  65.         RemovePlayer(Player)
  66.     end)
  67. end
  68. for i,v in pairs(Players:GetPlayers()) do
  69.     InitPlayer(v)
  70. end
  71.  
  72. Players.PlayerAdded:Connect(InitPlayer)
  73.  
  74. -- Keep track of players, so you actually see them moving.
  75.  
  76. game:GetService("RunService").RenderStepped:Connect(function()
  77.     for Original,Clone in pairs(ReplicateList) do
  78.         if Original ~= nil and Clone ~= nil then
  79.             if Original:IsA("BasePart") then
  80.                 pcall(function()
  81.                     Clone.CFrame = Original.CFrame
  82.                 end)
  83.             else
  84.                 pcall(function()
  85.                     Clone.Health = Original.Health
  86.                     Clone.MaxHealth = Original.MaxHealth
  87.                 end)
  88.             end
  89.         end
  90.     end
  91. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement