Advertisement
marcelslibrary

visualsv2

Nov 12th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.12 KB | None | 0 0
  1. local r = game:GetService("RunService")
  2. local Players = game:GetService("Players") or game.Players
  3. local Workspace = game:GetService("Workspace") or workspace or game.Workspace
  4. local L = game:GetService("Lighting") or game.Lighting
  5. local http = game:GetService("HttpService")
  6. local user = game:GetService("UserInputService")
  7. local RS = game:GetService("ReplicatedStorage") or game.ReplicatedStorage
  8. local TS = game:GetService("TweenService")
  9. local CG = game:GetService("CoreGui")
  10. local Teams = game:GetService("Teams") or game.Teams
  11. local Camera = Workspace.CurrentCamera or Workspace:FindFirstChild("Camera")
  12.  
  13. local LP = Players.LocalPlayer
  14. local Mouse = LP:GetMouse()
  15.  
  16.  
  17. local Colors = {
  18. Red = Color3.fromRGB(100,0,0),
  19. Green = Color3.fromRGB(0,100,0),
  20. Blue = Color3.fromRGB(0,0,100),
  21. Tracers = Color3.fromRGB(),
  22. ESP = Color3.fromRGB(),
  23. HeadDot = Color3.fromRGB(),
  24. ChamsColor = Color3.fromRGB(),
  25. Boxes = Color3.fromRGB(),
  26. Crosshair = Color3.fromRGB(100,0,255),
  27. }
  28.  
  29. local functions = { }
  30. local visuals = {
  31. tracer_shit = {
  32. enabled = false,
  33. x = {},
  34. obj = {},
  35. },
  36.  
  37. esp_shit = {
  38. enabled = false,
  39. x = {},
  40. obj = {},
  41. },
  42.  
  43. headdot_shit = {
  44. enabled = false,
  45. x = {},
  46. },
  47.  
  48. chams_shit = {
  49. enabled = false,
  50. x = {},
  51. obj = {},
  52. },
  53.  
  54. box_shit = {
  55. x = {},
  56. enabled = false,
  57. },
  58.  
  59. crosshair_shit = {},
  60.  
  61. circlecrosshair_shit = {},
  62.  
  63. fullbright_shit = {
  64. enabled = false,
  65. x = {},
  66. },
  67.  
  68.  
  69. Settings = {
  70. Enemy = false,
  71. BoxFilled = false,
  72. CircleFilled = true,
  73. DistanceVal = 2500,
  74. Distance false,
  75.  
  76. TracerColors = true,
  77. ESPColors = true,
  78. HeadDotColors = true,
  79. BoxColors = true,
  80. },
  81. loops = {},
  82. }
  83.  
  84. function functions:GetDistance(plr)
  85. local char = plr.Character or plr.CharacterAdded:wait()
  86. if char and Character then
  87. local hum = char:FindFirstChild("HumanoidRootPart") or char:WaitForChild("HumanoidRootPart")
  88. local hum1 = Character:FindFirstChild("HumanoidRootPart") or Character:WaitForChild("HumanoidRootPart")
  89. if hum and hum1 then
  90. local dist = (hum1.Position - hum.Position).magnitude
  91. return dist
  92. else
  93. return 999
  94. end
  95. end
  96. end
  97.  
  98. function functions:GetTeamColor(player)
  99. if LP.Team == player.Team then
  100. return Color3.new(0, 1, 0)
  101. end;
  102. if tostring(LP.Team) == "Prisoner" then
  103. if tostring(player.Team) == "Police" then
  104. return Color3.new(1, 0, 0)
  105. else
  106. return Color3.new(0, 1, 0)
  107. end
  108. elseif tostring(LP.Team) == "Criminal" then
  109. if tostring(player.Team) == "Police" then
  110. return Color3.new(1, 0, 0)
  111. else
  112. return Color3.new(0, 1, 0)
  113. end
  114. elseif tostring(LP.Team) == "Police" then
  115. if tostring(player.Team) == "Criminal" then
  116. return Color3.new(1, 0, 0)
  117. else
  118. return Color3.new(1, 1, 0)
  119. end
  120. end;
  121. return Color3.new(1, 0, 0)
  122. end
  123.  
  124. function functions:CreateLoop(name, func, waitt, canBeDestroyed, ...)
  125. if visuals.loops[name] ~= nil then return end
  126.  
  127. visuals.loops[name] = { }
  128. visuals.loops[name].Running = false
  129. visuals.loops[name].Destroy = false
  130. visuals.loops[name].CanBeDestroyed = canBeDestroyed
  131. visuals.loops[name].Loop = coroutine.create(function(...)
  132. while true do
  133. if visuals.loops[name].Running then
  134. func(...)
  135. end
  136.  
  137. if visuals.loops[name].Destroy then
  138. break
  139. end
  140.  
  141. if type(wait) == "userdata" then
  142. waitt:wait()
  143. else
  144. wait(waitt)
  145. end
  146. end
  147. end)
  148. end
  149.  
  150. function functions:RunLoop(name, func, waitt, canBeDestroyed, ...)
  151. if visuals.loops[name] == nil then
  152. if func ~= nil then
  153. self:CreateLoop(name, func, waitt, canBeDestroyed, ...)
  154. end
  155. end
  156.  
  157. visuals.loops[name].Running = true
  158. local succ, out = coroutine.resume(visuals.loops[name].Loop)
  159. if not succ then
  160. warn("Loop: " .. tostring(name) .. " ERROR: " .. tostring(out))
  161. end
  162. end
  163.  
  164. function functions:StopLoop(name)
  165. if visuals.loops[name] == nil then return end
  166.  
  167. visuals.loops[name].Running = false
  168. end
  169.  
  170. function functions:DestroyLoop(name)
  171. if visuals.loops[name] == nil then return end
  172.  
  173. self:StopLoop(name)
  174. visuals.loops[name].Destroy = true
  175.  
  176. visuals.loops[name] = nil
  177. end
  178.  
  179. function functions:DestroyAllLoops()
  180. for i, v in next, visuals.loops do
  181. self:DestroyLoop(i)
  182. end
  183. end
  184.  
  185. function functions:CreateFolder(name,parent)
  186. local x = Instance.new("Folder",parent)
  187. x.Name = name
  188. return x
  189. end
  190.  
  191.  
  192.  
  193. do--tracer
  194.  
  195. function visuals.tracer_shit.obj:CreateTracer(obj)
  196. local x = Drawing.new("Line")
  197. self[tostring(obj)] = {}
  198. self[tostring(obj)].enabled = false
  199. self[tostring(obj)].obj = x
  200. x.Thickness = 2
  201. x.Visible = self.obj[tostring(obj)].enabled
  202. x.Color = Colors.Blue
  203. return x
  204. end
  205.  
  206. function visuals.tracer_shit.obj:RemoveTracer(obj)
  207. if self.obj[tostring(obj)] ~= nil then
  208. self.obj[tostring(obj)]:Remove()
  209. self[tostring(obj)] = nil
  210. end
  211. end
  212.  
  213. function visuals.tracer_shit.obj:UpdateTracer(obj)
  214. local x = self[tostring(obj)].obj
  215. if x then
  216. local x1, x2 = Camera:WorldToViewportPoint(obj.CFrame.p - Vector3.new(0, 3, 0))
  217. if x2 and isrbxactive() then
  218. x.Visible = true
  219. x.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)
  220. x.To = Vector2.new(x1.X,x1.Y)
  221. else
  222. x.Visible = false
  223. end
  224. end
  225. end
  226.  
  227.  
  228.  
  229.  
  230. function visuals.tracer_shit:CreateTracer(plr)
  231. local x = Drawing.new("Line")
  232. x.Thickness = 2
  233. x.Visible = self.enabled
  234. self.x[tostring(plr)] = x
  235. if visuals.Settings.TracerColors then
  236. x.Color = functions:GetTeamColor(plr)
  237. else
  238. x.Color = Colors.Tracers
  239. end
  240. return x
  241. end
  242.  
  243. function visuals.tracer_shit:RemoveTracer(plr)
  244. if self.x[tostring(plr)] ~= nil then
  245. self.x[tostring(plr)]:Remove()
  246. self.x[tostring(plr)] = nil
  247. end
  248. end
  249.  
  250. function visuals.tracer_shit:UpdateTracer(plr)
  251. local x = self.x[tostring(plr)]
  252. local char = plr.Character
  253. if char and x then
  254.  
  255. if functions:GetDistance(plr) > visuals.Settings.DistanceVal then
  256. x.Visible = false
  257. return
  258. end
  259.  
  260.  
  261. if plr.Name == LP.Name or plr.Team == LP.Team then return end
  262.  
  263. local t = char:FindFirstChild("HumanoidRootPart")
  264. if t then
  265. local x1, x2 = Camera:WorldToViewportPoint(t.CFrame.p - Vector3.new(0, 3, 0))
  266. if x2 and isrbxactive() then
  267. x.Visible = self.enabled
  268. x.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)
  269. x.To = Vector2.new(x1.X,x1.Y)
  270. if visuals.Settings.TracerColors then
  271. x.Color = functions:GetTeamColor(plr)
  272. else
  273. x.Color = Colors.Tracers
  274. end
  275.  
  276. else
  277. x.Visible = false
  278. end
  279.  
  280. end
  281. end
  282. end
  283.  
  284. function visuals.tracer_shit:Init()
  285. functions:CreateLoop("UpdatePlayerTracers",function()
  286. for i,v in pairs(Players:GetPlayers()) do
  287. self:UpdateTracer(v)
  288. end
  289. end,r.RenderStepped)
  290.  
  291. for i,v in pairs(Players:GetPlayers()) do
  292. self:CreateTracer(v)
  293. end
  294.  
  295. Players.PlayerAdded:connect(function(x)
  296. self:CreateTracer(x)
  297. end)
  298.  
  299. Players.PlayerRemoving:connect(function(x)
  300. self:RemoveTracer(x)
  301. end)
  302. end
  303. end--tracer
  304.  
  305.  
  306. do--head dot
  307. function visuals.headdot_shit:CreateDot(plr)
  308. local char = plr.Character or plr.CharacterAdded:wait()
  309. if char then
  310. local head = char:FindFirstChild("Head")
  311. if head then
  312. local x = Drawing.new("Circle")
  313. if visuals.Settings.TracerColors then
  314. x.Color = functions:GetTeamColor(plr)
  315. else
  316. x.Color = Colors.HeadDot
  317. end
  318. x.Filled = visuals.Settings.CircleFilled
  319. x.Transparency = 0.4
  320. x.Visible = self.enabled
  321. self.x[tostring(plr)] = x
  322. end
  323. end
  324. end
  325.  
  326. function visuals.headdot_shit:UpdateDot(plr)
  327. local x = self.x[tostring(plr)]
  328. local char = plr.Character or plr.CharacterAdded:wait()
  329. if char then
  330. local head = char:FindFirstChild("Head")
  331. if x and head then
  332. local pos, scr = Camera:WorldToViewportPoint(head.Position)
  333.  
  334. if functions:GetDistance(plr) > visuals.Settings.DistanceVal then
  335. x.Visible = false
  336. return
  337. end
  338.  
  339. if plr.Name == LP.Name or plr.Team == LP.Team then return end
  340. if isrbxactive() and scr then
  341. if visuals.Settings.TracerColors then
  342. x.Color = functions:GetTeamColor(plr)
  343. else
  344. x.Color = Colors.HeadDot
  345. end
  346. x.Radius = 700 / pos.Z
  347. x.Filled = visuals.Settings.CircleFilled
  348. x.Visible = self.enabled
  349. x.Position = Vector2.new(pos.X, pos.Y)
  350. else
  351. x.Visible = false
  352. end
  353. end
  354. end
  355. end
  356.  
  357. function visuals.headdot_shit:RemoveDot(plr)
  358. if self.x[tostring(plr)] ~= nil then
  359. self.x[tostring(plr)]:Remove()
  360. self.x[tostring(plr)] = nil
  361. end
  362. end
  363.  
  364. function visuals.headdot_shit:Init()
  365. functions:CreateLoop("UpdatePlayerDot",function()
  366. for i,v in pairs(Players:GetPlayers()) do
  367. self:UpdateDot(v)
  368. end
  369. end,r.RenderStepped)
  370.  
  371. for i,v in pairs(Players:GetPlayers()) do
  372. self:CreateDot(v)
  373. end
  374.  
  375. Players.PlayerAdded:connect(function(x)
  376. self:CreateDot(x)
  377. end)
  378.  
  379. Players.PlayerRemoving:connect(function(x)
  380. self:RemoveDot(x)
  381. end)
  382. end
  383. end--head dot
  384.  
  385.  
  386. do--box esp
  387. function visuals.box_shit:CreateBox(parent,size,color)
  388. local ESP = Instance.new("BillboardGui")
  389. local Frame = Instance.new("Frame")
  390. local Frame_2 = Instance.new("Frame")
  391. local Frame_3 = Instance.new("Frame")
  392. local Frame_4 = Instance.new("Frame")
  393. local Frame_5 = Instance.new("Frame")
  394. --Properties:
  395. ESP.Name = "BoxESP"
  396. ESP.Parent = parent
  397. ESP.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  398. ESP.Active = true
  399. ESP.LightInfluence = 1
  400. ESP.Size = size
  401. ESP.AlwaysOnTop = true
  402. ESP.Adornee = parent
  403.  
  404. Frame.Parent = ESP
  405. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  406. Frame.BackgroundTransparency = 1
  407. Frame.BorderSizePixel = 0
  408. Frame.Size = UDim2.new(1, -2, 1, -2)
  409.  
  410. Frame_2.Parent = Frame
  411. Frame_2.BackgroundColor3 = color
  412. Frame_2.BorderSizePixel = 0
  413. Frame_2.Size = UDim2.new(1, 0, 0, 1)
  414.  
  415. Frame_3.Parent = Frame
  416. Frame_3.BackgroundColor3 = color
  417. Frame_3.BorderSizePixel = 0
  418. Frame_3.Position = UDim2.new(0, 0, 1, 0)
  419. Frame_3.Size = UDim2.new(1, 0, 0, 1)
  420.  
  421. Frame_4.Parent = Frame
  422. Frame_4.BackgroundColor3 = color
  423. Frame_4.BorderSizePixel = 0
  424. Frame_4.Size = UDim2.new(0, 1, 1, 0)
  425.  
  426. Frame_5.Parent = Frame
  427. Frame_5.BackgroundColor3 = color
  428. Frame_5.BorderSizePixel = 0
  429. Frame_5.Position = UDim2.new(1, 0, 0, 0)
  430. Frame_5.Size = UDim2.new(0, 1, 1, 0)
  431. end
  432. end--box esp
  433.  
  434. do--fullbright
  435. function visuals.fullbright_shit:Init()
  436. self.x["Ambient"] = L.Ambient
  437. self.x["Brightness"] = L.Brightness
  438. self.x["ColorShift_Bottom"] = L.ColorShift_Bottom
  439. self.x["ColorShift_Top"] = L.ColorShift_Top
  440. self.x["OutdoorAmbient"] = L.OutdoorAmbient
  441. visuals.Initialized.Fullbright = true;
  442. end
  443.  
  444. function visuals.fullbright_shit:Enabled()
  445. L.Ambient = Color3.new(1, 1, 1)
  446. L.Brightness = 2
  447. L.ColorShift_Bottom = Color3.new(1, 1, 1)
  448. L.ColorShift_Top = Color3.new(1, 1, 1)
  449. L.OutdoorAmbient = Color3.new(1, 1, 1)
  450. end
  451.  
  452. function visuals.fullbright_shit:Disable()
  453. for i,v in pairs(self.x) do
  454. L[i] = v
  455. end
  456. end
  457.  
  458. end--fullbright
  459.  
  460. do--crosshair
  461. function visuals.crosshair_shit:Enable()
  462. visuals.crosshair_shit.x.To = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2) - 12, (Workspace.CurrentCamera.ViewportSize.Y / 2))
  463. visuals.crosshair_shit.x.From = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2) + 12, (Workspace.CurrentCamera.ViewportSize.Y / 2))
  464. visuals.crosshair_shit.y.To = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2), (Workspace.CurrentCamera.ViewportSize.Y / 2) - 12)
  465. visuals.crosshair_shit.y.From = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2), (Workspace.CurrentCamera.ViewportSize.Y / 2) + 12)
  466. visuals.crosshair_shit.x.Visible = true
  467. visuals.crosshair_shit.y.Visible = true
  468. end
  469.  
  470. function visuals.crosshair_shit:Init()
  471. visuals.crosshair_shit.x = Drawing.new("Line")
  472. visuals.crosshair_shit.x.Visible = false
  473. visuals.crosshair_shit.x.Thickness = 3
  474. visuals.crosshair_shit.x.Color = Colors.Crosshair
  475.  
  476. visuals.crosshair_shit.y = Drawing.new("Line")
  477. visuals.crosshair_shit.y.Visible = false
  478. visuals.crosshair_shit.y.Thickness = 3
  479. visuals.crosshair_shit.y.Color = Colors.Crosshair
  480. end
  481.  
  482. function visuals.crosshair_shit:Disable()
  483. visuals.crosshair_shit.x.Visible = false
  484. visuals.crosshair_shit.y.Visible = false
  485. end
  486.  
  487. end--crosshair
  488.  
  489. do--circle crosshair
  490. function visuals.circlecrosshair_shit:Enable()
  491. visuals.circlecrosshair_shit.z.Position = Vector2.new(Workspace.CurrentCamera.ViewportSize.X / 2, Workspace.CurrentCamera.ViewportSize.Y / 2)
  492. visuals.circlecrosshair_shit.z.Visible = true
  493. end
  494.  
  495. function visuals.circlecrosshair_shit:Init()
  496. visuals.circlecrosshair_shit.z = Drawing.new("Circle")
  497. visuals.circlecrosshair_shit.z.Visible = false
  498. visuals.circlecrosshair_shit.z.Radius = 50
  499. visuals.circlecrosshair_shit.z.Filled = false
  500. visuals.circlecrosshair_shit.z.Transparency = 0.4
  501. visuals.circlecrosshair_shit.z.NumSides = 12
  502. visuals.circlecrosshair_shit.z.Thickness = 5
  503. visuals.circlecrosshair_shit.z.Color = Colors.Crosshair
  504. end
  505.  
  506. function visuals.circlecrosshair_shit:Disable()
  507. visuals.circlecrosshair_shit.z.Visible = false
  508. end
  509.  
  510. end--circle
  511.  
  512. return visuals
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement