Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- visuals library hahaaaaa
- ]]
- local r = game:GetService("RunService")
- local Players = game:GetService("Players") or game.Players
- local Workspace = game:GetService("Workspace") or workspace or game.Workspace
- local L = game:GetService("Lighting") or game.Lighting
- local http = game:GetService("HttpService")
- local user = game:GetService("UserInputService")
- local RS = game:GetService("ReplicatedStorage") or game.ReplicatedStorage
- local TS = game:GetService("TweenService")
- local CG = game:GetService("CoreGui")
- local Teams = game:GetService("Teams") or game.Teams
- local Camera = Workspace.CurrentCamera or Workspace:FindFirstChild("Camera")
- local LP = Players.LocalPlayer
- local PG = LP.PlayerGui or LP:FindFirstChild("PlayerGui")
- local BP = LP.Backpack or LP:FindFirstChild("Backpack")
- local PS = LP.PlayerScripts or LP:FindFirstChild("PlayerScripts")
- local Mouse = LP:GetMouse()
- local Character = LP:FindFirstChild("Character") or LP.Character
- local Colors = {
- Red = Color3.fromRGB(100,0,0),
- Green = Color3.fromRGB(0,100,0),
- Blue = Color3.fromRGB(0,0,100),
- Tracers = Color3.fromRGB(50,0,200),
- ESP = Color3.fromRGB(100,0,255),
- HeadDot = Color3.fromRGB(200,0,255),
- ChamsColor = Color3.fromRGB(100,0,255),
- Boxes = Color3.fromRGB(100,0,255),
- Crosshair = Color3.fromRGB(100,0,255),
- }
- local functions = { }
- local visuals = {
- tracer_shit = {
- enabled = false,
- x = {},
- obj = {},
- },
- esp_shit = {
- enabled = false,
- x = {},
- obj = {},
- },
- headdot_shit = {
- enabled = false,
- x = {},
- },
- chams_shit = {
- enabled = false,
- x = {},
- obj = {},
- },
- box_shit = {
- x = {},
- enabled = false,
- },
- crosshair_shit = {},
- circlecrosshair_shit = {},
- fullbright_shit = {
- enabled = false,
- x = {},
- },
- Settings = {
- Enemy = false,
- BoxFilled = false,
- CircleFilled = true,
- TracerColors = true,
- ESPColors = true,
- HeadDotColors = true,
- BoxColors = true,
- },
- loops = {},
- }
- function functions:GetTeamColor(player)
- if LP.Team == player.Team then
- return Color3.new(0, 1, 0)
- end;
- if tostring(LP.Team) == "Prisoner" then
- if tostring(player.Team) == "Police" then
- return Color3.new(1, 0, 0)
- else
- return Color3.new(0, 1, 0)
- end
- elseif tostring(LP.Team) == "Criminal" then
- if tostring(player.Team) == "Police" then
- return Color3.new(1, 0, 0)
- else
- return Color3.new(0, 1, 0)
- end
- elseif tostring(LP.Team) == "Police" then
- if tostring(player.Team) == "Criminal" then
- return Color3.new(1, 0, 0)
- else
- return Color3.new(1, 1, 0)
- end
- end;
- return Color3.new(1, 0, 0)
- end
- function functions:CreateLoop(name, func, waitt, canBeDestroyed, ...)
- if visuals.loops[name] ~= nil then return end
- visuals.loops[name] = { }
- visuals.loops[name].Running = false
- visuals.loops[name].Destroy = false
- visuals.loops[name].CanBeDestroyed = canBeDestroyed
- visuals.loops[name].Loop = coroutine.create(function(...)
- while true do
- if visuals.loops[name].Running then
- func(...)
- end
- if visuals.loops[name].Destroy then
- break
- end
- if type(wait) == "userdata" then
- waitt:wait()
- else
- wait(waitt)
- end
- end
- end)
- end
- function functions:RunLoop(name, func, waitt, canBeDestroyed, ...)
- if visuals.loops[name] == nil then
- if func ~= nil then
- self:CreateLoop(name, func, waitt, canBeDestroyed, ...)
- end
- end
- visuals.loops[name].Running = true
- local succ, out = coroutine.resume(visuals.loops[name].Loop)
- if not succ then
- warn("Loop: " .. tostring(name) .. " ERROR: " .. tostring(out))
- end
- end
- function functions:StopLoop(name)
- if visuals.loops[name] == nil then return end
- visuals.loops[name].Running = false
- end
- function functions:DestroyLoop(name)
- if visuals.loops[name] == nil then return end
- self:StopLoop(name)
- visuals.loops[name].Destroy = true
- visuals.loops[name] = nil
- end
- function functions:DestroyAllLoops()
- for i, v in next, visuals.loops do
- self:DestroyLoop(i)
- end
- end
- function functions:CreateFolder(name,parent)
- local x = Instance.new("Folder",parent)
- x.Name = name
- return x
- end
- do--tracer
- function visuals.tracer_shit.obj:CreateTracer(obj)
- local x = Drawing.new("Line")
- self[tostring(obj)] = {}
- self[tostring(obj)].enabled = false
- self[tostring(obj)].obj = x
- x.Thickness = 2
- x.Visible = self.obj[tostring(obj)].enabled
- x.Color = Colors.Blue
- return x
- end
- function visuals.tracer_shit.obj:RemoveTracer(obj)
- if self.obj[tostring(obj)] ~= nil then
- self.obj[tostring(obj)]:Remove()
- self[tostring(obj)] = nil
- end
- end
- function visuals.tracer_shit.obj:UpdateTracer(obj)
- local x = self[tostring(obj)].obj
- if x then
- local x1, x2 = Camera:WorldToViewportPoint(obj.CFrame.p - Vector3.new(0, 3, 0))
- if x2 and isrbxactive() then
- x.Visible = true
- x.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)
- x.To = Vector2.new(x1.X,x1.Y)
- else
- x.Visible = false
- end
- end
- end
- function visuals.tracer_shit:CreateTracer(plr)
- local x = Drawing.new("Line")
- x.Thickness = 2
- x.Visible = self.enabled
- self.x[tostring(plr)] = x
- if visuals.Settings.TracerColors then
- x.Color = functions:GetTeamColor(plr)
- else
- x.Color = Colors.Tracers
- end
- return x
- end
- function visuals.tracer_shit:RemoveTracer(plr)
- if self.x[tostring(plr)] ~= nil then
- self.x[tostring(plr)]:Remove()
- self.x[tostring(plr)] = nil
- end
- end
- function visuals.tracer_shit:UpdateTracer(plr)
- local x = self.x[tostring(plr)]
- local char = plr.Character
- if char and x then
- if plr.Team == LP.Team and visuals.Settings.Enemy then
- x.Visible = false
- return
- end
- if plr.Name == LP.Name then return end
- local t = char:FindFirstChild("HumanoidRootPart")
- if t then
- local x1, x2 = Camera:WorldToViewportPoint(t.CFrame.p - Vector3.new(0, 3, 0))
- if x2 and isrbxactive() then
- x.Visible = self.enabled
- x.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)
- x.To = Vector2.new(x1.X,x1.Y)
- if visuals.Settings.TracerColors then
- x.Color = functions:GetTeamColor(plr)
- else
- x.Color = Colors.Tracers
- end
- else
- x.Visible = false
- end
- end
- end
- end
- function visuals.tracer_shit:Init()
- functions:CreateLoop("UpdatePlayerTracers",function()
- for i,v in pairs(Players:GetPlayers()) do
- self:UpdateTracer(v)
- end
- end,r.RenderStepped)
- for i,v in pairs(Players:GetPlayers()) do
- self:CreateTracer(v)
- end
- Players.PlayerAdded:connect(function(x)
- self:CreateTracer(x)
- end)
- Players.PlayerRemoving:connect(function(x)
- self:RemoveTracer(x)
- end)
- end
- end
- do--esp
- function visuals.esp_shit.obj:CreateESP(obj)
- local x = Drawing.new("Text")
- self[tostring(obj)] = {}
- self[tostring(obj)].enabled = false
- self[tostring(obj)].obj = x
- x.Visible = self[tostring(obj)].enabled
- x.Color = Colors.Blue
- x.Center = true
- return x
- end
- function visuals.esp_shit.obj:UpdateESP(obj,text)
- if obj then
- local x = self[tostring(obj)]
- x.Visible = x.enabled
- end
- end
- function visuals.esp_shit.obj:RemoveESP(obj)
- if self[tostring(obj)].obj ~= nil then
- self[tostring(obj)].obj:Remove()
- self[tostring(obj)].obj = nil
- end
- end
- function visuals.esp_shit:CreateESP(plr)
- local char = plr.Character or plr.CharacterAdded:wait()
- if char then
- local tor = char:FindFirstChild("HumanoidRootPart") or char:WaitForChild("HumanoidRootPart")
- local head = char:FindFirstChild("Head") or char:WaitForChild("Head")
- if tor and head then
- local pos = Camera:WorldToScreenPoint(head.Position)
- local x = Drawing.new("Text")
- x.Text = tostring(plr)
- x.Visible = self.enabled
- x.Size = 15
- x.Position = Vector2.new(pos.X, pos.Y+15)
- x.Center = true
- self.x[tostring(plr)] = x
- if visuals.Settings.TracerColors then
- x.Color = functions:GetTeamColor(plr)
- else
- x.Color = Colors.ESP
- end
- return x
- end
- end
- end
- function visuals.esp_shit:RemoveESP(plr)
- if self.x[tostring(plr)] ~= nil then
- self.x[tostring(plr)]:Remove()
- self.x[tostring(plr)] = nil
- end
- end
- function visuals.esp_shit:UpdateESP(plr)
- local x = self.x[tostring(plr)]
- local char = plr.Character or plr.CharacterAdded:wait()
- if char then
- local head = char:FindFirstChild("Head")
- local tor = char:FindFirstChild("HumanoidRootPart")
- if x and tor and head then
- local pos1, pos2 = Camera:WorldToScreenPoint(head.Position)
- if plr.Team == LP.Team and visuals.Settings.Enemy then
- x.Visible = false
- return
- end
- if plr.Name == LP.Name then return end
- if isrbxactive() and pos2 then
- if visuals.Settings.TracerColors then
- x.Color = functions:GetTeamColor(plr)
- else
- x.Color = Colors.ESP
- end
- x.Visible = self.enabled
- x.Position = Vector2.new(pos1.X, pos1.Y)
- else
- x.Visible = false
- end
- end
- end
- end
- function visuals.esp_shit:Init()
- functions:CreateLoop("UpdatePlayerESP",function()
- for i,v in pairs(Players:GetPlayers()) do
- self:UpdateESP(v)
- end
- end,r.RenderStepped)
- for i,v in pairs(Players:GetPlayers()) do
- self:CreateESP(v)
- end
- Players.PlayerAdded:connect(function(x)
- self:CreateESP(x)
- end)
- Players.PlayerRemoving:connect(function(x)
- self:RemoveESP(x)
- end)
- end
- end
- do--head dot
- function visuals.headdot_shit:CreateDot(plr)
- local char = plr.Character or plr.CharacterAdded:wait()
- if char then
- local head = char:FindFirstChild("Head")
- if head then
- local x = Drawing.new("Circle")
- if visuals.Settings.TracerColors then
- x.Color = functions:GetTeamColor(plr)
- else
- x.Color = Colors.HeadDot
- end
- x.Filled = visuals.Settings.CircleFilled
- x.Transparency = 0.4
- x.Visible = self.enabled
- self.x[tostring(plr)] = x
- end
- end
- end
- function visuals.headdot_shit:UpdateDot(plr)
- local x = self.x[tostring(plr)]
- local char = plr.Character or plr.CharacterAdded:wait()
- if char then
- local head = char:FindFirstChild("Head")
- if x and head then
- local pos, scr = Camera:WorldToViewportPoint(head.Position)
- if plr.Team == LP.Team and visuals.Settings.Enemy then
- x.Visible = false
- return
- end
- if plr.Name == LP.Name then return end
- if isrbxactive() and scr then
- if visuals.Settings.TracerColors then
- x.Color = functions:GetTeamColor(plr)
- else
- x.Color = Colors.HeadDot
- end
- x.Radius = 700 / pos.Z
- x.Filled = visuals.Settings.CircleFilled
- x.Visible = self.enabled
- x.Position = Vector2.new(pos.X, pos.Y)
- else
- x.Visible = false
- end
- end
- end
- end
- function visuals.headdot_shit:RemoveDot(plr)
- if self.x[tostring(plr)] ~= nil then
- self.x[tostring(plr)]:Remove()
- self.x[tostring(plr)] = nil
- end
- end
- function visuals.headdot_shit:Init()
- functions:CreateLoop("UpdatePlayerDot",function()
- for i,v in pairs(Players:GetPlayers()) do
- self:UpdateDot(v)
- end
- end,r.RenderStepped)
- for i,v in pairs(Players:GetPlayers()) do
- self:CreateDot(v)
- end
- Players.PlayerAdded:connect(function(x)
- self:CreateDot(x)
- end)
- Players.PlayerRemoving:connect(function(x)
- self:RemoveDot(x)
- end)
- end
- end
- do--box
- function visuals.box_shit:CreateBox(plr)
- local char = plr.Character or plr.CharacterAdded:wait()
- if char then
- local head = char:FindFirstChild("Head") or char:WaitForChild("Head")
- local hum = char:FindFirstChild("Torso") or char:WaitForChild("Torso")
- if hum and head then
- local tleft = Drawing.new("Line")
- local tright = Drawing.new("Line")
- local bleft = Drawing.new("Line")
- local bright = Drawing.new("Line")
- tleft.Visible = self.enabled
- tright.Visible = self.enabled
- bleft.Visible = self.enabled
- bright.Visible = self.enabled
- self.x[tostring(plr)] = {}
- self.x[tostring(plr)].tleft = tleft
- self.x[tostring(plr)].tright = tright
- self.x[tostring(plr)].bleft = bleft
- self.x[tostring(plr)].bright = bright
- end
- end
- end
- function visuals.box_shit:UpdateBox(plr)
- local x = self.x[tostring(plr)]
- if x ~= nil then
- local char = plr.Character or plr.CharacterAdded:wait()
- if char then
- local hum = char:FindFirstChild("Torso") or char:WaitForChild("Torso")
- if hum then
- local x,vis = Camera:WorldToScreenPoint((hum.CFrame * CFrame.new(2, 3, 0)).p)
- local x1,vis1 = Camera:WorldToScreenPoint((hum.CFrame * CFrame.new(-2, 3, 0)).p)
- local x2,vis2 = Camera:WorldToScreenPoint((hum.CFrame * CFrame.new(2, -3, 0)).p)
- local x3,vis3 = Camera:WorldToScreenPoint((hum.CFrame * CFrame.new(-2, -3, 0)).p)
- local a = self.x[tostring(plr)].tleft
- local b = self.x[tostring(plr)].tright
- local c = self.x[tostring(plr)].bleft
- local d = self.x[tostring(plr)].bright
- if a and b and c and d then
- if plr.Team == LP.Team and visuals.Settings.Enemy then
- a.Visible = false
- b.Visible = false
- c.Visible = false
- d.Visible = false
- return
- end
- if plr.Name == LP.Name then return end
- if vis and isrbxactive() then
- a.Visible = self.enabled
- a.From = Vector2.new(x.X,x.Y)
- a.To = Vector2.new(x1.X,x1.Y)
- if visuals.Settings.BoxColors then
- a.Color = functions:GetTeamColor(plr)
- else
- a.Color = Colors.Boxes
- end
- else
- a.Visible = false
- end
- if vis1 and isrbxactive() then
- b.Visible = self.enabled
- b.From = Vector2.new(x1.X,x1.Y)
- b.To = Vector2.new(x3.X,x3.Y)
- if visuals.Settings.BoxColors then
- b.Color = functions:GetTeamColor(plr)
- else
- b.Color = Colors.Boxes
- end
- else
- b.Visible = false
- end
- if vis2 and isrbxactive() then
- c.Visible = self.enabled
- c.From = Vector2.new(x2.X,x2.Y)
- c.To = Vector2.new(x.X,x.Y)
- if visuals.Settings.BoxColors then
- c.Color = functions:GetTeamColor(plr)
- else
- c.Color = Colors.Boxes
- end
- else
- c.Visible = false
- end
- if vis3 and isrbxactive() then
- d.Visible = self.enabled
- d.From = Vector2.new(x3.X,x3.Y)
- d.To = Vector2.new(x2.X,x2.Y)
- if visuals.Settings.BoxColors then
- d.Color = functions:GetTeamColor(plr)
- else
- d.Color = Colors.Boxes
- end
- else
- d.Visible = false
- end
- end
- end
- end
- end
- end
- function visuals.box_shit:RemoveBox(plr)
- if self.x[tostring(plr)] ~= nil then
- for i,v in pairs(self.x[tostring(plr)]) do
- v:Remove()
- end
- self.x[tostring(plr)] = nil
- end
- end
- function visuals.box_shit:Init()
- functions:CreateLoop("UpdatePlayerBox",function()
- for i,v in pairs(Players:GetPlayers()) do
- self:UpdateBox(v)
- end
- end,r.RenderStepped)
- for i,v in pairs(Players:GetPlayers()) do
- self:CreateBox(v)
- end
- Players.PlayerAdded:connect(function(x)
- self:CreateBox(x)
- end)
- Players.PlayerRemoving:connect(function(x)
- self:RemoveBox(x)
- end)
- end
- end--box
- do--fullbright
- function visuals.fullbright_shit:Init()
- self.x["Ambient"] = L.Ambient
- self.x["Brightness"] = L.Brightness
- self.x["ColorShift_Bottom"] = L.ColorShift_Bottom
- self.x["ColorShift_Top"] = L.ColorShift_Top
- self.x["OutdoorAmbient"] = L.OutdoorAmbient
- end
- function visuals.fullbright_shit:Enabled()
- L.Ambient = Color3.new(1, 1, 1)
- L.Brightness = 2
- L.ColorShift_Bottom = Color3.new(1, 1, 1)
- L.ColorShift_Top = Color3.new(1, 1, 1)
- L.OutdoorAmbient = Color3.new(1, 1, 1)
- end
- function visuals.fullbright_shit:Disable()
- for i,v in pairs(self.x) do
- L[i] = v
- end
- end
- end--fullbright
- do--crosshair
- function visuals.crosshair_shit:Enable()
- visuals.crosshair_shit.x.To = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2) - 12, (Workspace.CurrentCamera.ViewportSize.Y / 2))
- visuals.crosshair_shit.x.From = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2) + 12, (Workspace.CurrentCamera.ViewportSize.Y / 2))
- visuals.crosshair_shit.y.To = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2), (Workspace.CurrentCamera.ViewportSize.Y / 2) - 12)
- visuals.crosshair_shit.y.From = Vector2.new((Workspace.CurrentCamera.ViewportSize.X / 2), (Workspace.CurrentCamera.ViewportSize.Y / 2) + 12)
- visuals.crosshair_shit.x.Visible = true
- visuals.crosshair_shit.y.Visible = true
- end
- function visuals.crosshair_shit:Init()
- visuals.crosshair_shit.x = Drawing.new("Line")
- visuals.crosshair_shit.x.Visible = false
- visuals.crosshair_shit.x.Thickness = 1
- visuals.crosshair_shit.x.Color = Colors.Crosshair
- visuals.crosshair_shit.y = Drawing.new("Line")
- visuals.crosshair_shit.y.Visible = false
- visuals.crosshair_shit.y.Thickness = 1
- visuals.crosshair_shit.y.Color = Colors.Crosshair
- end
- function visuals.crosshair_shit:Disable()
- visuals.crosshair_shit.x.Visible = false
- visuals.crosshair_shit.y.Visible = false
- end
- end--crosshair
- do--circle crosshair
- function visuals.circlecrosshair_shit:Enable()
- visuals.circlecrosshair_shit.z.Position = Vector2.new(Workspace.CurrentCamera.ViewportSize.X / 2, Workspace.CurrentCamera.ViewportSize.Y / 2)
- visuals.circlecrosshair_shit.z.Visible = true
- end
- function visuals.circlecrosshair_shit:Init()
- visuals.circlecrosshair_shit.z = Drawing.new("Circle")
- visuals.circlecrosshair_shit.z.Visible = false
- visuals.circlecrosshair_shit.z.Radius = 50
- visuals.circlecrosshair_shit.z.Filled = false
- visuals.circlecrosshair_shit.z.Transparency = 0.4
- visuals.circlecrosshair_shit.z.NumSides = 12
- visuals.circlecrosshair_shit.z.Thickness = 1
- visuals.circlecrosshair_shit.z.Color = Colors.Crosshair
- end
- function visuals.circlecrosshair_shit:Disable()
- visuals.circlecrosshair_shit.z.Visible = false
- end
- end--circle
- visuals.box_shit:Init()
- visuals.tracer_shit:Init()
- visuals.esp_shit:Init()
- visuals.headdot_shit:Init()
- visuals.crosshair_shit:Init()
- visuals.circlecrosshair_shit:Init()
- functions:RunLoop("UpdatePlayerBox")
- functions:RunLoop("UpdatePlayerDot")
- functions:RunLoop("UpdatePlayerTracers")
- functions:RunLoop("UpdatePlayerESP")
- return visuals
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement