Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

MrBrickYT Apr 10th, 2020 169 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
  2. local CurrentCamera = workspace.CurrentCamera
  3.  
  4.  
  5. local env = getsenv(game:GetService("Players").LocalPlayer.PlayerGui.Client)
  6. local fire = env.firebullet
  7. local targetCFrame = nil
  8.  
  9.  
  10. function GetNearestPlayerCFrame()
  11.     local shortestDistance = 300
  12.     local HeadCFrame
  13.  
  14.         for i, v in pairs(game:GetService("Players"):GetPlayers()) do
  15.             if v ~= game:GetService("Players").LocalPlayer and v.TeamColor ~= game:GetService("Players").LocalPlayer.TeamColor and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Gun") then
  16.                 local pos = CurrentCamera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  17.                 local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
  18.  
  19.                 if magnitude < shortestDistance then
  20.                     HeadCFrame = CFrame.new(CurrentCamera.Focus.p, v.Character.Head.CFrame * Vector3.new(0, -0.25, 0)) * CFrame.new(0, 0, 0.5)
  21.                     shortestDistance = magnitude
  22.                 end
  23.             end
  24.         end
  25.     return HeadCFrame or nil
  26. end
  27.  
  28.  
  29. env.firebullet = function(fanfire)
  30.     targetCFrame = GetNearestPlayerCFrame()
  31.     fire(fanfire)
  32.     targetCFrame = nil
  33. end
  34.  
  35.  
  36. local mt = getrawmetatable(game)
  37. if setreadonly then setreadonly(mt, false) else make_writeable(mt, true) end
  38. local indexed = mt.__index
  39.  
  40. mt.__index = newcclosure(function(self, key)
  41.     local callerScript = rawget(getfenv(0), "script")
  42.     callerScript = typeof(callerScript) == "Instance" and callerScript or nil
  43.     local scriptName = indexed(callerScript, "Name")
  44.  
  45.     if scriptName == "Client" and self == CurrentCamera and (key == "CFrame" or key == "CoordinateFrame") and GetNearestPlayerCFrame() then
  46.         return GetNearestPlayerCFrame()
  47.     end
  48.  
  49.     return indexed(self, key, value)
  50. end)
  51.  
  52. if setreadonly then setreadonly(mt, true) else make_writeable(mt, false) end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top