Shocker130000

Katarina ESP

May 6th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.61 KB | None | 0 0
  1. -- Made by Katarina @V3rm
  2. -- Version: 2
  3. -- Please do check the pastebin from time to time to see if there are any new updates.
  4. -- Still working on the Phantom Forces version, if you're rushing to objectives you should have no problems with this. If you're sniping like a pussy ass bitch, bullets will still miss no mater what. (Working on a fix)
  5.  
  6. local Plrs = game:GetService('Players')
  7. local MyPlr = Plrs.LocalPlayer
  8. repeat
  9. wait()
  10. until MyPlr.Character ~= nil
  11. local MyChar = MyPlr.Character
  12. local MyGui = game:GetService('CoreGui')
  13. local RunS = game:GetService('RunService')
  14. local Teams = game:GetService('Teams')
  15. local C = workspace.CurrentCamera
  16. repeat
  17. RunS.RenderStepped:wait()
  18. until C.ViewportSize.X > 0 and C.ViewportSize.Y > 0
  19.  
  20. -- EDIT BELOW --
  21. local Settings = {
  22. KeyCodeToToggle = 285, -- Not done. (Doesn't work)
  23. KeyCodeToScrollRight = 275, -- Not done. (Doesn't work)
  24. KeyCodeToScrollLeft = 276, -- Not done. (Doesn't work)
  25. ColorCodes = {
  26. Enemy = Color3.new(1, 0, 0), -- Done. Change to your liking.
  27. Ally = Color3.new(0, 1, 0), -- Done. Change to your liking.
  28. },
  29. ShowTracers = true, -- Done. Change to false to disable tracers.
  30. TracerOptions = {
  31. ShowEnemies = true, -- Not done. (Doesn't work)
  32. ShowAllies = true, -- Not done. (Doesn't work)
  33. },
  34. ShowESP = true, -- Done. Change to false to disable ESP.
  35. ESPOptions = {
  36. ShowEnemies = true,-- Not done. (Doesn't work)
  37. ShowAllies = true,-- Not done. (Doesn't work)
  38. ShowHealth = true,-- Not done. (Doesn't work)
  39. ShowName = true,-- Not done. (Doesn't work)
  40. ShowDistance = true,-- Not done. (Doesn't work)
  41. },
  42. -- EDIT ABOVE --
  43. -- DO NOT EDIT BELOW! --
  44. PlayerESPCrap = {},
  45. PlayerCrap = {},
  46. FakeCrap = {},
  47. }
  48. local CC = Settings.ColorCodes
  49. local TO = Settings.TracerOptions
  50. local ESPO = Settings.ESPOptions
  51. local PESPC = Settings.PlayerESPCrap
  52. local PC = Settings.PlayerCrap
  53.  
  54. local DONT_IGNORE = {
  55. "Head",
  56. "Torso",
  57. "HumanoidRootPart",
  58. "Left Arm",
  59. "Right Arm",
  60. "Left Leg",
  61. "Right Leg",
  62. }
  63.  
  64. function CheckNameToDontIgnore(Str)
  65. for i, v in pairs(DONT_IGNORE) do
  66. if (Str == v) then
  67. return true
  68. end
  69. end
  70.  
  71. return false
  72. end
  73.  
  74. local Called = 0
  75. function AddShitToIgnoreList(Par)
  76. Called = Called + 1
  77. local Hint = Instance.new("Hint", workspace)
  78. Hint.Text = "Called: " .. Called
  79. -- Don't judge...
  80. print("Preparing ESP...")
  81. print("This could take a while...")
  82. wait(5)
  83. local function ScanEverything(Par)
  84. for i, v in pairs(Par:GetChildren()) do
  85. if not (CheckNameToDontIgnore(v.Name)) then
  86. table.insert(Settings.FakeCrap, v)
  87. print("Added " .. v.Name)
  88. v.ChildAdded:connect(function(EEEE)
  89. ScanEverything(EEEE)
  90. end)
  91. ScanEverything(v)
  92. else
  93. ScanEverything(v)
  94. end
  95. end
  96. end
  97.  
  98. local function Scan(Par)
  99. for i, v in pairs(Par:GetChildren()) do
  100. if not (Plrs:FindFirstChild(v.Name)) then
  101. table.insert(Settings.FakeCrap, v)
  102. print("Added " .. v.Name)
  103. else
  104. ScanEverything(v)
  105. end
  106. RunS.RenderStepped:wait()
  107. end
  108. end
  109. Scan(Par)
  110. end
  111.  
  112. function RecursiveGetChildren(Par)
  113. local returnValue = {}
  114.  
  115. local rgc
  116. rgc = function(Par)
  117. for i, c in next, Par:GetChildren() do
  118. table.insert(returnValue, c)
  119. rgc(c)
  120. end
  121. end
  122.  
  123. rgc(Par)
  124.  
  125. return returnValue
  126. end
  127.  
  128. function CheckCameraForPlrModel(Plr)
  129. local Find = C:FindFirstChild("ESPStuff " .. Plr.Name)
  130. if (Find) then
  131. local Find2 = Find:FindFirstChild("Tracer Stuff")
  132. if not (Find2) then
  133. local T = Instance.new("Model", Find)
  134. T.Name = "Tracer Stuff"
  135. end
  136. Find2 = Find:FindFirstChild("ESP Stuff")
  137. if not (Find2) then
  138. local T = Instance.new("Model", Find)
  139. T.Name = "ESP Stuff"
  140. end
  141. return Find
  142. end
  143. local mod = Instance.new("Model", C)
  144. mod.Name = "ESPStuff " .. Plr.Name
  145. local T = Instance.new("Model", mod)
  146. T.Name = "Tracer Stuff"
  147. local ESP = Instance.new("Model", mod)
  148. ESP.Name = "ESP Stuff"
  149. return mod
  150. end
  151.  
  152. function UpdateTracerCrap(What, Plr)
  153. if ((MyPlr.Character ~= nil and Plr.Character ~= nil) and (MyPlr.Character.PrimaryPart ~= nil and Plr.Character.PrimaryPart ~= nil)) then
  154. if ((MyPlr.Character.PrimaryPart.Position - Plr.Character.PrimaryPart.Position).magnitude < 2000) then
  155. local P = What.Part
  156. P.Transparency = 0
  157. local M = P.Mesh
  158. if (Plr.Character == nil) then -- Only if the player character is nil do we wait for it, or updating the tracer would be laggy as fuck
  159. repeat
  160. RunS.RenderStepped:wait()
  161. until Plr.Character ~= nil
  162. end
  163. local R = C:ScreenPointToRay(C.ViewportSize.X / 2, C.ViewportSize.Y, 0)
  164. local Dist = (R.Origin - (Plr.Character.PrimaryPart.Position - Vector3.new(0, 3, 0))).magnitude
  165. P.Size = Vector3.new(0.1, 0.1, Dist)
  166. P.CFrame = CFrame.new(R.Origin, (Plr.Character.PrimaryPart.Position - Vector3.new(0, 4.5, 0))) * CFrame.new(0, 0, -Dist / 2)
  167. P.BrickColor = BrickColor.new(
  168. #Teams:GetChildren() > 0 and (
  169. Plr.TeamColor == MyPlr.TeamColor and CC.Ally or
  170. Plr.TeamColor ~= MyPlr.TeamColor and CC.Enemy
  171. ) or #Teams:GetChildren() <= 0 and CC.Enemy
  172. )
  173. M.Scale = Vector3.new(0.05, 0.05, P.Size.Z / Dist)
  174. else
  175. local P = What.Part
  176. P.Transparency = 1
  177. end
  178. end
  179. end
  180.  
  181.  
  182. local Aim = 1
  183. function UpdateESPGui(HealthBar, HealthTxt, Plr, DistTxt, PlrName)
  184. if (Plr.Character == nil) then
  185. repeat
  186. RunS.RenderStepped:wait()
  187. until Plr.Character ~= nil
  188. end
  189. if ((Plr.Character.PrimaryPart.Position - MyPlr.Character.PrimaryPart.Position).magnitude <= 2000) then
  190. HealthBar.Parent.Parent.Visible = true
  191. else
  192. HealthBar.Parent.Parent.Visible = false
  193. end
  194. HealthBar.Size = UDim2.new(Plr.Character.Humanoid.Health / Plr.Character.Humanoid.MaxHealth, -2, 1, -2)
  195. HealthTxt.Text = math.floor(Plr.Character.Humanoid.Health) .. "/" .. math.floor(Plr.Character.Humanoid.MaxHealth)
  196. local Dist = (Plr.Character.PrimaryPart.Position - MyPlr.Character.PrimaryPart.Position).magnitude
  197. DistTxt.Text = math.floor(Dist) .. " Studs"
  198. PlrName.TextColor3 = (
  199. #Teams:GetChildren() > 0 and (
  200. Plr.TeamColor == MyPlr.TeamColor and CC.Ally or
  201. Plr.TeamColor ~= MyPlr.TeamColor and CC.Enemy
  202. ) or #Teams:GetChildren() <= 0 and CC.Enemy
  203. )
  204. DistTxt.TextColor3 = (
  205. #Teams:GetChildren() > 0 and (
  206. Plr.TeamColor == MyPlr.TeamColor and CC.Ally or
  207. Plr.TeamColor ~= MyPlr.TeamColor and CC.Enemy
  208. ) or #Teams:GetChildren() <= 0 and CC.Enemy
  209. )
  210. end
  211.  
  212. function UpdateESPCrap(What, Plr)
  213. if ((MyPlr.Character ~= nil and Plr.Character ~= nil) and (MyPlr.Character.PrimaryPart ~= nil and Plr.Character.PrimaryPart ~= nil)) then
  214. if ((MyPlr.Character.PrimaryPart.Position - Plr.Character.PrimaryPart.Position).magnitude < 2000) then
  215. if (PC[Plr] ~= nil) then
  216. local viewpoint = C.CoordinateFrame
  217.  
  218. local PDists = {}
  219. for i, p in next, PC[Plr] do
  220. table.insert(PDists, (viewpoint.p - i.Position).magnitude)
  221. end
  222.  
  223. local nearestDistance = math.min(unpack(PDists))
  224. local furthestDistance = math.max(unpack(PDists))
  225.  
  226. for i, p in next, PC[Plr] do
  227. local O, M, S = unpack(p)
  228.  
  229.  
  230. local Dist = (i.Position - viewpoint.p).magnitude
  231. local DistMult = Aim + (Dist - nearestDistance) / (furthestDistance - nearestDistance)
  232.  
  233. O.Transparency = math.max(S + (i.Transparency * (1 - S)), 0.001)
  234.  
  235. local unit = (i.Position - viewpoint.p).unit * DistMult
  236. local pos = viewpoint.p + unit
  237.  
  238. local OF = CFrame.new(pos) * CFrame.Angles(i.CFrame:toEulerAnglesXYZ())
  239.  
  240. O.CFrame = OF
  241.  
  242. local OS = DistMult / Dist
  243.  
  244. if (M == nil) then
  245. O.Mesh.Scale = i.Size * OS
  246. else
  247. if (M:IsA("SpecialMesh") and M.MeshType.Name == "FileMesh") or (M:IsA("SpecialMesh") == false) then
  248. O[M.Name].Scale = M.Scale * OS
  249. else
  250. O[M.Name].Scale = M.Scale * i.Size * OS
  251. end
  252. end
  253.  
  254. O.BrickColor = BrickColor.new(
  255. #Teams:GetChildren() > 0 and (
  256. Plr.TeamColor == MyPlr.TeamColor and CC.Ally or
  257. Plr.TeamColor ~= MyPlr.TeamColor and CC.Enemy
  258. ) or #Teams:GetChildren() <= 0 and CC.Enemy
  259. )
  260. end
  261.  
  262. --print("Running")
  263. local Mouse = MyPlr:GetMouse()
  264. local R = Ray.new(Mouse.UnitRay.Origin, Mouse.UnitRay.Direction * 5000)
  265. local RP = workspace:FindPartOnRayWithIgnoreList(R, Settings.FakeCrap, false, true)
  266. if (RP ~= nil) then
  267. local Find = Plrs:FindFirstChild(RP.Parent.Name) or Plrs:FindFirstChild(string.sub(RP.Parent.Name, string.len("ESPStuff ") + 1))
  268. if ((Find and Find:IsA("Player")) and (Find ~= MyPlr and Find == Plr)) then
  269. Aim = 500000
  270. wait(3)
  271. else
  272. Aim = 1
  273. end
  274. else
  275. Aim = 1
  276. end
  277. end
  278. end
  279. end
  280. end
  281.  
  282. function CreateESPStuff(Plr)
  283. local ESPModel = CheckCameraForPlrModel(Plr)
  284. PESPC[Plr] = ESPModel
  285. if (Settings.ShowTracers) then
  286. local T = ESPModel["Tracer Stuff"]
  287. if not (T:FindFirstChild(Plr.Name)) then
  288. local mod = Instance.new("Model", T)
  289. mod.Name = Plr.Name
  290. local P = Instance.new("Part", mod)
  291. P.FormFactor = "Custom"
  292. P.Material = "Neon"
  293. P.Transparency = 0
  294. P.Anchored = true
  295. P.Locked = true
  296. P.CanCollide = false
  297. table.insert(Settings.FakeCrap, P)
  298. local M = Instance.new("BlockMesh", P)
  299. RunS:BindToRenderStep("TracerUpdate " .. Plr.Name, Enum.RenderPriority.Character.Value - 1, function()
  300. UpdateTracerCrap(mod, Plr)
  301. end)
  302. end
  303. end
  304. if (Settings.ShowESP) then
  305. local ESP = ESPModel["ESP Stuff"]
  306. local mod = Instance.new("Model", ESP)
  307. mod.Name = Plr.Name
  308. repeat
  309. RunS.RenderStepped:wait()
  310. until Plr.Character ~= nil
  311. for i, v in next, RecursiveGetChildren(Plr.Character) do
  312. if (v:IsA("BasePart")) then
  313. local O = Instance.new("Part", mod)
  314. O.Anchored = true
  315. O.CanCollide = false
  316. O.FormFactor = "Custom"
  317. O.Size = Vector3.new(1, 1, 1)
  318. O.Name = "Fake " .. v.Name
  319. O.Material = "SmoothPlastic"
  320. O.TopSurface = "SmoothNoOutlines"
  321. O.BottomSurface = "SmoothNoOutlines"
  322. O.FrontSurface = "SmoothNoOutlines"
  323. O.BackSurface = "SmoothNoOutlines"
  324. O.LeftSurface = "SmoothNoOutlines"
  325. O.RightSurface = "SmoothNoOutlines"
  326.  
  327. local P = nil
  328. local PMesh = nil
  329. for ii, vv in next, RecursiveGetChildren(v) do
  330. if (vv:IsA("DataModelMesh")) then
  331. local ThisPMesh = vv:clone()
  332.  
  333. local meshChanged = vv.Changed:connect(function(Prop)
  334. if (Prop == "MeshType" or Prop == "MeshId" or Prop == "TextureProp") then
  335. ThisPMesh[Prop] = vv[Prop]
  336. end
  337. end)
  338.  
  339. PMesh = ThisPMesh
  340. elseif (vv:IsA("FaceInstance")) then
  341. vv:clone().Parent = O
  342. end
  343. end
  344.  
  345. if (PMesh == nil) then
  346. local M = Instance.new("BlockMesh", O)
  347. else
  348. PMesh:clone().Parent = O
  349. end
  350.  
  351. if (O.Name == "Fake Head") then
  352. local Info = Instance.new("BillboardGui", O.Mesh)
  353. Info.Name = "ESPStats"
  354. Info.Adornee = O
  355. Info.Size = UDim2.new(0, 100, 0, 75)
  356. Info.ExtentsOffset = Vector3.new(0, 0.3, 0)
  357.  
  358. local Stats = Instance.new("Frame", Info)
  359. Stats.BackgroundTransparency = 1
  360. Stats.Name = "Stats"
  361. Stats.Size = UDim2.new(1, 0, 1, 0)
  362. Stats.Visible = false
  363.  
  364. local Health = Instance.new("Frame", Stats)
  365. Health.Name = "HealthBG"
  366. Health.BackgroundColor3 = Color3.new(0, 0, 0)
  367. Health.BorderSizePixel = 0
  368. Health.Position = UDim2.new(0, 0, 0, 25)
  369. Health.Size = UDim2.new(1, 0, 0, 25)
  370.  
  371. local HealthBG = Instance.new("Frame", Health)
  372. HealthBG.Name = "Health"
  373. HealthBG.BackgroundColor3 = Color3.new(0, 1, 0)
  374. HealthBG.BorderSizePixel = 0
  375. HealthBG.Position = UDim2.new(0, 1, 0, 1)
  376. HealthBG.Size = UDim2.new(1, -2, 1, -2)
  377.  
  378. local HealthNum = Instance.new("TextLabel", Health)
  379. HealthNum.Name = "HealthNum"
  380. HealthNum.BackgroundTransparency = 1
  381. HealthNum.Size = UDim2.new(1, 0, 1, 0)
  382. HealthNum.Font = "Legacy"
  383. HealthNum.FontSize = "Size8"
  384. HealthNum.Text = "???"
  385. HealthNum.TextColor3 = Color3.new(1, 0, 0)
  386.  
  387. local PlrName = Instance.new("TextLabel", Stats)
  388. PlrName.Name = "PlrName"
  389. PlrName.BackgroundTransparency = 1
  390. PlrName.Size = UDim2.new(1, 0, 0, 25)
  391. PlrName.Font = "Legacy"
  392. PlrName.FontSize = "Size8"
  393. PlrName.Text = Plr.Name
  394. PlrName.TextColor3 = (
  395. #Teams:GetChildren() > 0 and (
  396. Plr.TeamColor == MyPlr.TeamColor and CC.Ally or
  397. Plr.TeamColor ~= MyPlr.TeamColor and CC.Enemy
  398. ) or #Teams:GetChildren() <= 0 and CC.Enemy
  399. )
  400.  
  401. local PlrDist = PlrName:clone()
  402. PlrDist.Parent = PlrName.Parent
  403. PlrDist.Name = "Dist"
  404. PlrDist.Text = "???"
  405. PlrDist.Position = UDim2.new(0, 0, 0, 50)
  406. PlrDist.TextColor3 = (
  407. #Teams:GetChildren() > 0 and (
  408. Plr.TeamColor == MyPlr.TeamColor and CC.Ally or
  409. Plr.TeamColor ~= MyPlr.TeamColor and CC.Enemy
  410. ) or #Teams:GetChildren() <= 0 and CC.Enemy
  411. )
  412. RunS:BindToRenderStep("UpdateESPGui " .. Plr.Name, Enum.RenderPriority.Character.Value - 1, function()
  413. UpdateESPGui(HealthBG, HealthNum, Plr, PlrDist, PlrName)
  414. end)
  415. end
  416.  
  417. if (PC[Plr] == nil) then
  418. PC[Plr] = {}
  419. end
  420. PC[Plr][v] = {O, PMesh, 0}
  421. table.insert(Settings.FakeCrap, O)
  422. table.insert(Settings.FakeCrap, PMesh)
  423. end
  424. end
  425. RunS:BindToRenderStep("UpdateESP " .. Plr.Name, Enum.RenderPriority.Character.Value - 1, function()
  426. UpdateESPCrap(mod, Plr)
  427. end)
  428. end
  429. end
  430.  
  431. function RemoveESP(Plr)
  432. RunS:UnbindFromRenderStep("UpdateESP " .. Plr.Name)
  433. RunS:UnbindFromRenderStep("UpdateESPGui " .. Plr.Name)
  434. local Find = C:FindFirstChild("ESPStuff " .. Plr.Name)
  435. if (Find) then
  436. Find = Find:FindFirstChild("ESP Stuff")
  437. if (Find) then
  438. Find:Destroy()
  439. end
  440. end
  441. PC[Plr] = {}
  442. end
  443.  
  444. function OnCharacterAdded(Char, Plr)
  445. RemoveESP(Plr)
  446. CreateESPStuff(Plr)
  447. -- Added shit to ingore list
  448. end
  449.  
  450. function OnPlayerAdded(Plr)
  451. CreateESPStuff(Plr)
  452. Plr.CharacterAdded:connect(function(Char)
  453. OnCharacterAdded(Char, Plr)
  454. end)
  455. end
  456.  
  457. function OnPlayerRemoved(Plr)
  458. RunS:UnbindFromRenderStep("TracerUpdate " .. Plr.Name)
  459. RunS:UnbindFromRenderStep("UpdateESP " .. Plr.Name)
  460. RunS:UnbindFromRenderStep("UpdateESPGui " .. Plr.Name)
  461. local Find = C:FindFirstChild("ESPStuff " .. Plr.Name)
  462. if (Find) then
  463. Find:Destroy()
  464. end
  465. end
  466.  
  467. function GetCurrentPlayers()
  468. for i, v in pairs(Plrs:GetPlayers()) do
  469. if (v ~= MyPlr) then
  470. CreateESPStuff(v)
  471. v.CharacterAdded:connect(function(Char)
  472. OnCharacterAdded(Char, v)
  473. end)
  474. end
  475. end
  476. end
  477.  
  478. print("Please wait....")
  479. wait(0.5)
  480. AddShitToIgnoreList(workspace)
  481. GetCurrentPlayers()
  482. Plrs.PlayerAdded:connect(OnPlayerAdded)
  483. Plrs.PlayerRemoving:connect(OnPlayerRemoved)
Add Comment
Please, Sign In to add comment