Advertisement
plytalent

ESP

Dec 22nd, 2020 (edited)
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 33.05 KB | None | 0 0
  1. if not _G.require then
  2.     _G.require = require
  3. end
  4.  
  5. --// API References
  6. local GUIData = (function()
  7.     -- Variables
  8.     _V = 1.11
  9.  
  10.     local screenGui = (script:FindFirstChild("ScreenGui")) or game:GetObjects("rbxassetid://2718157603")[1]:FindFirstChild("ScreenGui", true)
  11.     local Container = screenGui.Frame
  12.     local Opt = Container.OptionsFrame
  13.     local Checkbox = Opt.Checkbox
  14.     local Color = Opt.Color
  15.     local Frame = Opt.Frame
  16.     local Execute = Opt.Execute
  17.     local Mode = Opt.Mode
  18.     local Number = Opt.Number
  19.     local Toggle = Opt.Toggle
  20.     local Mods = screenGui.Mods
  21.     local ModLabel = Mods.Example
  22.  
  23.     local TextService = game:GetService("TextService")
  24.     local UserInputService = game:GetService("UserInputService")
  25.     local HttpService = game:GetService("HttpService")
  26.     local Player = game:GetService("Players").LocalPlayer
  27.     local Mouse = Player:GetMouse()
  28.     syn = syn or nil
  29.     if syn then
  30.         syn.protect_gui(screenGui)
  31.     end
  32.     local err,errcode=pcall(function()
  33.         screenGui.Parent = game:GetService("CoreGui")
  34.     end)
  35.     if not err then
  36.         print("ERR:",errcode)
  37.         screenGui.Parent = Player.PlayerGui
  38.     end
  39.  
  40.     Container.Parent = nil
  41.     Checkbox.Parent = nil
  42.     Color.Parent = nil
  43.     Frame.Parent = nil
  44.     Execute.Parent = nil
  45.     Mode.Parent = nil
  46.     Number.Parent = nil
  47.     Toggle.Parent = nil
  48.     ModLabel.Parent = nil
  49.  
  50.     local settingsArray = {{Object = screenGui},{}}
  51.     local saveData = {Options = {}, Hotkeys = {}}
  52.  
  53.     local hotkeyFunctions = {}
  54.     local gui = {}
  55.  
  56.     -- Save Functions
  57.     local writefile = writefile or function() end
  58.     local function Save()
  59.         local JSONData = HttpService:JSONEncode(saveData)
  60.         writefile("OpenGui.txt", JSONData)
  61.     end
  62.  
  63.     -- Color Functions
  64.     local color = {}
  65.     local colors = {
  66.         TextDisabled = Color3.fromRGB(200, 200, 200),
  67.         TextEnabled = Color3.fromRGB(255, 255, 255),
  68.     }
  69.  
  70.     local Colors = {
  71.         Color3.fromRGB(255, 73, 73),
  72.         Color3.fromRGB(255, 161, 66),
  73.         Color3.fromRGB(255, 233, 62),
  74.         Color3.fromRGB(137, 255, 64),
  75.         Color3.fromRGB(64, 255, 140),
  76.         Color3.fromRGB(66, 252, 255),
  77.         Color3.fromRGB(64, 147, 255),
  78.         Color3.fromRGB(255, 93, 253),
  79.         Color3.fromRGB(195, 110, 255),
  80.         Color3.fromRGB(255, 90, 134),
  81.         Color3.fromRGB(255, 255, 255),
  82.         Color3.fromRGB(209, 209, 209),
  83.     }
  84.  
  85.     local function h2rgb(m1, m2, h)
  86.         if h<0 then h = h+1 end
  87.         if h>1 then h = h-1 end
  88.         if h*6<1 then
  89.             return m1+(m2-m1)*h*6
  90.         elseif h*2<1 then
  91.             return m2
  92.         elseif h*3<2 then
  93.             return m1+(m2-m1)*(2/3-h)*6
  94.         else
  95.             return m1
  96.         end
  97.     end
  98.  
  99.     function color:rgbToHsv(r, g, b)
  100.         local a = 0
  101.         r, g, b, a = r / 255, g / 255, b / 255, a / 255
  102.         local max, min = math.max(r, g, b), math.min(r, g, b)
  103.         local h, s, v
  104.         v = max
  105.  
  106.         local d = max - min
  107.         if max == 0 then s = 0 else s = d / max end
  108.  
  109.         if max == min then
  110.             h = 0 -- achromatic
  111.         else
  112.             if max == r then
  113.                 h = (g - b) / d
  114.                 if g < b then h = h + 6 end
  115.             elseif max == g then h = (b - r) / d + 2
  116.             elseif max == b then h = (r - g) / d + 4
  117.             end
  118.             h = h / 6
  119.         end
  120.  
  121.         return h, s, v
  122.     end
  123.  
  124.     function color:hslToRgb(h, s, L)
  125.         h = h / 360
  126.         local m2 = L <= .5 and L*(s+1) or L+s-L*s
  127.         local m1 = L*2-m2
  128.         return
  129.             h2rgb(m1, m2, h+1/3), h2rgb(m1, m2, h), h2rgb(m1, m2, h-1/3)
  130.     end
  131.  
  132.     function color:rgbToHsl(r, g, b)
  133.         local min = math.min(r, g, b)
  134.         local max = math.max(r, g, b)
  135.         local delta = max - min
  136.  
  137.         local h, s, l = 0, 0, (min + max) / 2
  138.  
  139.         if l > 0 and l < 0.5 then s = delta / (max + min) end
  140.         if l >= 0.5 and l < 1 then s = delta / (2 - max - min) end
  141.  
  142.         if delta > 0 then
  143.             if max == r and max ~= g then h = h + (g-b) / delta end
  144.             if max == g and max ~= b then h = h + 2 + (b-r) / delta end
  145.             if max == b and max ~= r then h = h + 4 + (r-g) / delta end
  146.             h = h / 6
  147.         end
  148.  
  149.         if h < 0 then h = h + 1 end
  150.         if h > 1 then h = h - 1 end
  151.  
  152.         return h * 360, s, l
  153.     end
  154.  
  155.     function color:adjustLightness(color3, amount)
  156.         local h, s, l = self:rgbToHsl(color3.r, color3.g, color3.b)
  157.         return Color3.new(self:hslToRgb(h, s, l + amount))
  158.     end
  159.  
  160.     -- UI Functions
  161.     function gui.tween(object,style,direction,t,goal)
  162.         local tweenservice = game:GetService("TweenService")
  163.         local tweenInfo = TweenInfo.new(t,Enum.EasingStyle[style],Enum.EasingDirection[direction])
  164.         local tween = tweenservice:Create(object,tweenInfo,goal)
  165.         tween.Completed:Connect(function()
  166.             tween:Destroy()
  167.         end)
  168.         tween:Play()
  169.         return tween
  170.     end
  171.  
  172.     function gui:makeDraggable(ui, callback)
  173.         local UserInputService = game:GetService("UserInputService")
  174.  
  175.         local dragging
  176.         local dragInput
  177.         local dragStart
  178.         local startPos
  179.  
  180.         local function update(input)
  181.             local delta = input.Position - dragStart
  182.             ui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  183.  
  184.             if callback then
  185.                 callback(ui.Position.X.Offset, ui.Position.Y.Offset)
  186.             end
  187.         end
  188.  
  189.         ui.InputBegan:Connect(function(input)
  190.             if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  191.                 dragging = true
  192.                 dragStart = input.Position
  193.                 startPos = ui.Position
  194.  
  195.                 input.Changed:Connect(function()
  196.                     if input.UserInputState == Enum.UserInputState.End then
  197.                         dragging = false
  198.                     end
  199.                 end)
  200.             end
  201.         end)
  202.  
  203.         ui.InputChanged:Connect(function(input)
  204.             if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  205.                 dragInput = input
  206.             end
  207.         end)
  208.  
  209.         UserInputService.InputChanged:Connect(function(input)
  210.             if input == dragInput and dragging then
  211.                 update(input)
  212.             end
  213.         end)
  214.     end
  215.  
  216.     function gui:unpack(data, type)
  217.         if data == nil then return end
  218.         if type == "UDim2" then
  219.             return data and UDim2.new(data[1], data[2], data[3], data[4])
  220.         elseif type == "boolean" then
  221.             return data == 1 and true or false
  222.         elseif type == "Color3" then
  223.             return Color3.new(data[1], data[2], data[3])
  224.         end
  225.         return data
  226.     end
  227.  
  228.     function gui:pack(data)
  229.         if typeof(data) == "UDim2" then
  230.             return {data.X.Scale, data.X.Offset, data.Y.Scale, data.Y.Offset}
  231.         elseif typeof(data) == "boolean" then
  232.             return data and 1 or 0
  233.         elseif typeof(data) == "Color3" then
  234.             return {data.r, data.g, data.b}
  235.         end
  236.         return data
  237.     end
  238.  
  239.     function gui:getn(array)
  240.         local n = 0
  241.         for _, v in pairs(array) do
  242.             n = n + 1
  243.         end
  244.         return n
  245.     end
  246.  
  247.     function gui:setText(textLabel, text)
  248.         text = tostring(text)
  249.         textLabel.Text = text
  250.         if textLabel:FindFirstChild("Opaque") then
  251.             textLabel.Opaque.Text = text
  252.         end
  253.         if textLabel:FindFirstChild("Shadow") then
  254.             textLabel.Shadow.Text = text
  255.         end
  256.     end
  257.  
  258.     function gui:onDoubleTap(guiObject, callback)
  259.         local lastTap = tick()
  260.         guiObject.InputBegan:Connect(function(input)
  261.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  262.                 if tick() - lastTap < 0.25 then
  263.                     callback()
  264.                 end
  265.                 lastTap = tick()
  266.             end
  267.         end)
  268.     end
  269.  
  270.     local connections = {}
  271.     function gui:connect(func)
  272.         table.insert(connections, func)
  273.     end
  274.  
  275.     function gui:createList(guiObject, guiData)
  276.         local ListLayout = guiObject.OptionsFrame.UIListLayout
  277.         local Padding = guiObject.OptionsFrame.UIPadding
  278.         guiObject.OptionsFrame.UIListLayout.Changed:Connect(function(Property)
  279.             if Property == "AbsoluteContentSize" then
  280.                 guiData.ySize = ListLayout.AbsoluteContentSize.Y + 2 + Padding.PaddingTop.Offset + ListLayout.Padding.Offset * 2
  281.             end
  282.         end)
  283.  
  284.         gui:connect(function()
  285.             if guiObject:FindFirstChild("Title") then
  286.                 local yRes = Mouse.ViewSizeY
  287.                 local diff = yRes - (guiData.yPos + guiData.ySize)
  288.                 local difference = math.clamp(diff, 0, 5000)
  289.                 guiObject.OptionsFrame.CanvasSize = UDim2.new(1, 0, 1.001, guiData.ySize - 35)
  290.  
  291.                 if guiData.Open then
  292.                     guiObject.OptionsFrame.Size = guiObject.OptionsFrame.Size:Lerp(UDim2.new(1, 0, 0, guiData.ySize + math.clamp(diff, -5000, 0)), 0.3)
  293.                 else
  294.                     guiObject.OptionsFrame.Size = guiObject.OptionsFrame.Size:Lerp(UDim2.new(1, 0, 0, 0), 0.3)
  295.                 end
  296.  
  297.                 guiObject.Frame.Size = guiObject.OptionsFrame.Size
  298.             else
  299.                 if guiData.Open then
  300.                     guiObject.Size = guiObject.Size:Lerp(UDim2.new(1, -8, 0, 35 + guiData.ySize), 0.3)
  301.                 else
  302.                     guiObject.Size = guiObject.Size:Lerp(UDim2.new(1, -8, 0, 35), 0.3)
  303.                 end
  304.             end
  305.         end)
  306.  
  307.         if guiObject:FindFirstChild("Dropdown") then
  308.             guiObject.Dropdown.Visible = false
  309.             guiObject.Dropdown.MouseButton1Down:Connect(function()
  310.                 guiData.Open = not guiData.Open
  311.                 if guiData.Open then
  312.                     guiObject.Dropdown.Image = "rbxassetid://3559638428"
  313.                 else
  314.                     guiObject.Dropdown.Image = "rbxassetid://3554238678"
  315.                 end
  316.             end)
  317.         else
  318.             gui:onDoubleTap(guiObject, function()
  319.                 guiData.Open = not guiData.Open
  320.             end)
  321.         end
  322.     end
  323.  
  324.     function gui:textColorOnHover(guiObject, guiData)
  325.         local hover = guiData.baseColor or guiObject.TextColor3
  326.         local default = color:adjustLightness(hover, -0.075)
  327.         local mdown = color:adjustLightness(hover, -0.15)
  328.         local mouseIn
  329.  
  330.         local function update()
  331.             if guiData.baseColor then
  332.                 hover = guiData.baseColor or guiObject.TextColor3
  333.                 default = color:adjustLightness(hover, -0.075)
  334.                 mdown = color:adjustLightness(hover, -0.15)
  335.             end
  336.         end
  337.  
  338.         guiObject.MouseEnter:Connect(function()
  339.             update()
  340.             gui.tween(guiObject, "Sine", "Out", 0.25, {
  341.                 TextColor3 = hover;
  342.             })
  343.             mouseIn = true
  344.         end)
  345.  
  346.         guiObject.MouseLeave:Connect(function()
  347.             mouseIn = false
  348.             update()
  349.             gui.tween(guiObject, "Sine", "Out", 0.25, {
  350.                 TextColor3 = default;
  351.             })
  352.         end)
  353.  
  354.         guiObject.InputBegan:Connect(function(input)
  355.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  356.                 update()
  357.                 gui.tween(guiObject, "Sine", "Out", 0.25, {
  358.                     TextColor3 = mdown;
  359.                 })
  360.             end
  361.         end)
  362.  
  363.         guiObject.InputEnded:Connect(function(input)
  364.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  365.                 update()
  366.                 gui.tween(guiObject, "Sine", "Out", 0.25, {
  367.                     TextColor3 = mouseIn and hover or default;
  368.                 })
  369.             end
  370.         end)
  371.  
  372.         guiObject.TextColor3 = default
  373.     end
  374.  
  375.     function gui:sliderXY(sliderFrame, inputObjects, callback)
  376.         local inputDown = false
  377.  
  378.         local function refresh(c1, c2)
  379.             local sliderX = sliderFrame.AbsolutePosition.X + sliderFrame.AbsoluteSize.X
  380.             local sliderY = sliderFrame.AbsolutePosition.Y + sliderFrame.AbsoluteSize.Y
  381.  
  382.             local distX = sliderX - Mouse.X
  383.             local distY = sliderY - Mouse.Y
  384.  
  385.             local deltaX = 1-math.clamp(distX / sliderFrame.AbsoluteSize.X, 0, 1)
  386.             local deltaY = 1-math.clamp(distY / sliderFrame.AbsoluteSize.Y, 0, 1)
  387.  
  388.             if callback then
  389.                 callback(c1 or deltaX, c2 or deltaY)
  390.             end
  391.         end
  392.  
  393.         for _, obj in pairs(inputObjects) do
  394.             obj.InputBegan:Connect(function(input)
  395.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  396.                     inputDown = true
  397.                     refresh()
  398.                 end
  399.             end)
  400.             obj.InputEnded:Connect(function(input)
  401.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  402.                     inputDown = false
  403.                     refresh()
  404.                 end
  405.             end)
  406.             obj.InputChanged:Connect(function(input)
  407.                 if input == nil or input.UserInputType == Enum.UserInputType.MouseMovement then
  408.                     if inputDown then
  409.                         refresh()
  410.                     end
  411.                 end
  412.             end)
  413.         end
  414.  
  415.         return refresh
  416.     end
  417.  
  418.     function gui:createSlider(sliderFrame, inputObjects, callback)
  419.         local slider = sliderFrame.Value
  420.         local inputDown = false
  421.  
  422.         local absPos = sliderFrame.AbsolutePosition.X + sliderFrame.AbsoluteSize.X
  423.         local absSize = sliderFrame.AbsoluteSize.X
  424.  
  425.         local function refresh(custom)
  426.             local mouseX = Mouse.X
  427.             local sliderX = absPos
  428.             local dist = sliderX - mouseX
  429.             local delta = 1 - math.clamp(dist / absSize, 0, 1)
  430.  
  431.             if custom then
  432.                 delta = custom
  433.             end
  434.  
  435.             slider.Size = UDim2.new(delta, 0, 1, 0)
  436.             if callback then
  437.                 callback(delta, custom)
  438.             end
  439.         end
  440.  
  441.         for _, obj in pairs(inputObjects) do
  442.             obj.InputBegan:Connect(function(input)
  443.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  444.                     inputDown = true
  445.                     absPos = sliderFrame.AbsolutePosition.X + sliderFrame.AbsoluteSize.X
  446.                     absSize = sliderFrame.AbsoluteSize.X
  447.                     refresh()
  448.                 end
  449.             end)
  450.             obj.InputEnded:Connect(function(input)
  451.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  452.                     inputDown = false
  453.                     refresh()
  454.                 end
  455.             end)
  456.             obj.InputChanged:Connect(function(input)
  457.                 if input == nil or input.UserInputType == Enum.UserInputType.MouseMovement then
  458.                     if inputDown then
  459.                         refresh()
  460.                     end
  461.                 end
  462.             end)
  463.         end
  464.  
  465.         return refresh
  466.     end
  467.  
  468.     function gui:textSize(txt, vSize)
  469.         return TextService:GetTextSize(txt.Text, txt.TextSize, txt.Font, vSize)
  470.     end
  471.  
  472.     local currentHint = 0
  473.  
  474.     function gui:addHint(guiObject, hintText)
  475.         local hintKey = math.random()
  476.         guiObject.MouseEnter:Connect(function()
  477.             hintKey = math.random()
  478.             currentHint = hintKey
  479.  
  480.             wait(2)
  481.  
  482.             if currentHint == hintKey then
  483.                 gui:setText(screenGui.Hint, " " .. hintText .. " ")
  484.                 local textSize = gui:textSize(screenGui.Hint, Vector2.new(2500, 500))
  485.                 screenGui.Hint.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y + 4)
  486.                 screenGui.Hint.Size = UDim2.new(0, textSize.X, 0, textSize.Y)
  487.                 screenGui.Hint.Visible = true
  488.             end
  489.         end)
  490.  
  491.         guiObject.MouseLeave:Connect(function()
  492.             hintKey = math.random()
  493.         end)
  494.  
  495.         Mouse.Move:Connect(function()
  496.             if currentHint == hintKey then
  497.                 screenGui.Hint.Visible = false
  498.             end
  499.         end)
  500.     end
  501.  
  502.     -- UI Type Library
  503.     local lib = {}
  504.  
  505.     function lib.Color(data, dataArray)
  506.         local guiObject = Color:Clone()
  507.         local color3Value = gui:unpack(saveData.Options[data.ID].Value, "Color3") or data.Default or Color3.new(1, 1, 1)
  508.         local guiData = {}
  509.  
  510.         local HSV = color3Value
  511.         local H, S, V = color:rgbToHsv(HSV.r * 255, HSV.g * 255, HSV.b * 255)
  512.  
  513.         local newValue = function()
  514.             HSV = Color3.fromHSV(H, S, V)
  515.             guiObject.SV.BackgroundColor3 = Color3.fromHSV(H, 1, 1)
  516.             guiObject.Indicator.BackgroundColor3 = HSV
  517.             saveData.Options[data.ID].Value = gui:pack(HSV, "Color3")
  518.  
  519.             guiObject.R.Text = math.floor(HSV.r * 255)
  520.             guiObject.G.Text = math.floor(HSV.g * 255)
  521.             guiObject.B.Text = math.floor(HSV.b * 255)
  522.  
  523.             if data.Callback then
  524.                 data.Callback(HSV)
  525.             end
  526.         end
  527.  
  528.         local function updateHSV()
  529.             H, S, V = color:rgbToHsv(HSV.r * 255, HSV.g * 255, HSV.b * 255)
  530.         end
  531.  
  532.         local H_set = gui:sliderXY(guiObject.H, {guiObject.H}, function(X, Y, u)
  533.             if not u then H = 1 - Y end
  534.             guiObject.H.Locator.Position = UDim2.new(0.5, 0, Y, 0)
  535.             newValue()
  536.         end)
  537.  
  538.         local SV_set = gui:sliderXY(guiObject.SV, {guiObject.SV}, function(X, Y, u)
  539.             if not u then S = X; V = 1 - Y; end
  540.             guiObject.SV.Locator.Position = UDim2.new(X, 0, Y, 0)
  541.             newValue()
  542.         end)
  543.  
  544.         guiObject.R.FocusLost:Connect(function()
  545.             HSV = Color3.new(guiObject.R.Text / 255, HSV.g, HSV.b)
  546.             updateHSV()
  547.             newValue()
  548.         end)
  549.         guiObject.G.FocusLost:Connect(function()
  550.             HSV = Color3.new(HSV.r, guiObject.G.Text / 255, HSV.b)
  551.             updateHSV()
  552.             newValue()
  553.         end)
  554.         guiObject.B.FocusLost:Connect(function()
  555.             HSV = Color3.new(HSV.r, HSV.g, guiObject.B.Text / 255)
  556.             updateHSV()
  557.             newValue()
  558.         end)
  559.  
  560.         newValue()
  561.         SV_set(S, 1 - V)
  562.         H_set(0, H)
  563.  
  564.         guiData.ySize = 0
  565.         guiData.Open = false
  566.         guiData.baseColor = colors.TextEnabled
  567.  
  568.         gui:setText(guiObject.Label, data.Name)
  569.         gui:textColorOnHover(guiObject.Label, guiData)
  570.  
  571.         return guiObject
  572.     end
  573.  
  574.     function lib.Number(data, dataArray)
  575.         local guiObject = Number:Clone()
  576.         local Value = gui:unpack(saveData.Options[data.ID].Value, "number") or data.Default or math.floor(data.Min + (data.Max - data.Min) / 2)
  577.         local guiData = {}
  578.  
  579.         local dMax = data.Max - data.Min
  580.         local dValue = (Value - data.Min) / dMax
  581.  
  582.         data.Round = data.Round or 1
  583.  
  584.         local newValue = function(delta)
  585.             local exactValue = data.Min + (data.Max - data.Min) * delta
  586.             Value = math.floor(exactValue / data.Round) * data.Round
  587.             Value = math.clamp(Value, data.Min, data.Max)
  588.             guiObject.Indicator.Value.Text = tostring(Value)
  589.  
  590.             if data.Callback then
  591.                 data.Callback(Value)
  592.             end
  593.             saveData.Options[data.ID].Value = gui:pack(Value, "number")
  594.         end
  595.  
  596.         local slideSet = gui:createSlider(guiObject.ValueFrame, {guiObject.Label, guiObject.Indicator}, newValue)
  597.         slideSet(math.clamp(dValue, 0, 1))
  598.  
  599.         guiObject.Indicator.MouseButton1Down:Connect(newValue)
  600.         guiObject.Label.MouseButton1Down:Connect(newValue)
  601.         newValue(math.clamp(dValue, 0, 1))
  602.  
  603.         guiData.ySize = 0
  604.         guiData.Open = false
  605.         guiData.baseColor = colors.TextEnabled
  606.  
  607.         gui:createList(guiObject, guiData)
  608.         gui:setText(guiObject.Label, data.Name)
  609.         gui:textColorOnHover(guiObject.Label, guiData)
  610.  
  611.         return guiObject
  612.     end
  613.  
  614.     function lib.Execute(data, dataArray)
  615.         local guiObject = Execute:Clone()
  616.         local guiData = {}
  617.  
  618.         local newValue = function(val)
  619.             if data.Callback then
  620.                 data.Callback()
  621.             end
  622.         end
  623.  
  624.         guiObject.MouseEnter:Connect(function()
  625.             gui.tween(guiObject.Indicator, "Sine", "Out", .25, {Size = UDim2.new(0, 40, 0, 25)})
  626.         end)
  627.  
  628.         guiObject.MouseLeave:Connect(function()
  629.             gui.tween(guiObject.Indicator, "Sine", "Out", .25, {Size = UDim2.new(0, 0, 0, 25)})
  630.         end)
  631.  
  632.         guiObject.Indicator.MouseButton1Down:Connect(newValue)
  633.         guiObject.Label.MouseButton1Down:Connect(newValue)
  634.         newValue(true)
  635.  
  636.         guiData.ySize = 0
  637.         guiData.Open = false
  638.         guiData.baseColor = colors.TextEnabled
  639.  
  640.         gui:createList(guiObject, guiData)
  641.         gui:setText(guiObject.Label, data.Name)
  642.         gui:textColorOnHover(guiObject.Label, guiData)
  643.  
  644.         return guiObject
  645.     end
  646.  
  647.     function lib.Mode(data, dataArray)
  648.         local guiObject = Mode:Clone()
  649.         local valueIndex = gui:unpack(saveData.Options[data.ID].Value, "number") or data.Default or 1
  650.         local guiData = {}
  651.  
  652.         local newValue = function(val)
  653.             if val == true then else
  654.                 valueIndex = (valueIndex % #data.Modes) + 1
  655.             end
  656.  
  657.             local Value = data.Modes[valueIndex]
  658.             gui:setText(guiObject.Mode, Value)
  659.  
  660.             if data.Callback then
  661.                 data.Callback(Value)
  662.             end
  663.             saveData.Options[data.ID].Value = gui:pack(valueIndex)
  664.         end
  665.  
  666.         guiObject.Mode.MouseButton1Down:Connect(newValue)
  667.         guiObject.Label.MouseButton1Down:Connect(newValue)
  668.         newValue(true)
  669.  
  670.         guiData.ySize = 0
  671.         guiData.Open = false
  672.         guiData.baseColor = colors.TextEnabled
  673.  
  674.         gui:createList(guiObject, guiData)
  675.         gui:setText(guiObject.Label, data.Name)
  676.         gui:textColorOnHover(guiObject.Label, guiData)
  677.  
  678.         return guiObject
  679.     end
  680.  
  681.     function lib.Hotkey(data, dataArray)
  682.         local guiObject = Mode:Clone()
  683.         local hotkeyInput = gui:unpack(saveData.Hotkeys[data.ID], "string") or data.Hotkey or ""
  684.         local guiData = {}
  685.  
  686.         local lastInput = hotkeyInput
  687.         local mouseIn = false
  688.  
  689.         guiObject.Name = "Z"
  690.  
  691.         local newValue = function(val)
  692.             local input
  693.             gui:setText(guiObject.Mode, "...")
  694.             saveData.Hotkeys[data.ID] = nil
  695.  
  696.             if not val then
  697.                 input = lastInput
  698.                 mouseIn = true
  699.  
  700.                 lastInput = nil
  701.  
  702.                 repeat wait() until mouseIn == false or lastInput
  703.             end
  704.  
  705.             if not lastInput then
  706.                 lastInput = hotkeyInput
  707.             end
  708.  
  709.             saveData.Hotkeys[data.ID] = tostring(lastInput)
  710.             hotkeyFunctions[data.ID] = data.callback
  711.  
  712.             hotkeyInput = tostring(lastInput)
  713.             saveData.Options[data.ID].Value = hotkeyInput
  714.             gui:setText(guiObject.Mode, hotkeyInput:sub(14))
  715.         end
  716.  
  717.         UserInputService.InputBegan:Connect(function(input)
  718.             if input.KeyCode == Enum.KeyCode.Unknown then return end
  719.             if input.KeyCode == Enum.KeyCode.Backspace then lastInput = "" return end
  720.             lastInput = tostring(input.KeyCode)
  721.         end)
  722.  
  723.         guiObject.Mode.MouseButton1Down:Connect(function() newValue() end)
  724.         guiObject.Label.MouseButton1Down:Connect(function() newValue() end)
  725.         guiObject.MouseLeave:Connect(function()
  726.             mouseIn = false
  727.         end)
  728.         newValue(true)
  729.  
  730.         guiData.ySize = 0
  731.         guiData.Open = false
  732.         guiData.baseColor = colors.TextEnabled
  733.  
  734.         gui:createList(guiObject, guiData)
  735.         gui:setText(guiObject.Label, "Hotkey")
  736.         gui:textColorOnHover(guiObject.Label, guiData)
  737.  
  738.         guiObject.Parent = dataArray.Object.OptionsFrame
  739.  
  740.         return guiObject
  741.     end
  742.  
  743.     function lib.Toggle(data, dataArray)
  744.         local guiObject = Toggle:Clone()
  745.         local Value = gui:unpack(saveData.Options[data.ID].Value, "boolean") or data.Default or false
  746.         local guiData = {}
  747.  
  748.         local modFrame = ModLabel:Clone()
  749.         modFrame.Parent = Mods
  750.         modFrame.TextColor3 = Colors[math.random(1, #Colors)]
  751.         modFrame.Visible = false
  752.         gui:setText(modFrame, data.Name)
  753.  
  754.         guiObject.Name = data.Name
  755.  
  756.         local newValue = function(val, set)
  757.             if val == true then
  758.             else
  759.                 if set then
  760.                     Value = set
  761.                 else
  762.                     Value = not Value
  763.                 end
  764.             end
  765.  
  766.             if Value then
  767.                 gui.tween(guiObject.Indicator, "Sine", "Out", .25, {BackgroundColor3 = Color3.fromRGB(60, 222, 60)})
  768.                 guiObject.Indicator.Text = "ON"
  769.                 guiData.baseColor = colors.TextEnabled
  770.             else
  771.                 gui.tween(guiObject.Indicator, "Sine", "Out", .25, {BackgroundColor3 = Color3.fromRGB(222, 60, 60)})
  772.                 guiObject.Indicator.Text = "OFF"
  773.                 guiData.baseColor = colors.TextDisabled
  774.             end
  775.  
  776.             if data.Callback then
  777.                 data.Callback(Value)
  778.             end
  779.  
  780.             saveData.Options[data.ID].Value = gui:pack(Value)
  781.             modFrame.Visible = Value
  782.  
  783.         end
  784.  
  785.         guiObject.MouseEnter:Connect(function()
  786.             gui.tween(guiObject.Indicator, "Sine", "Out", .25, {Size = UDim2.new(0, 40, 0, 25)})
  787.         end)
  788.  
  789.         guiObject.MouseLeave:Connect(function()
  790.             gui.tween(guiObject.Indicator, "Sine", "Out", .25, {Size = UDim2.new(0, 0, 0, 25)})
  791.         end)
  792.  
  793.         gui.tween(guiObject.Indicator, "Sine", "Out", .25, {Size = UDim2.new(0, 0, 0, 25)})
  794.         guiObject.Indicator.MouseButton1Down:Connect(function() newValue() end)
  795.         guiObject.Label.MouseButton1Down:Connect(function() newValue() end)
  796.         newValue(true)
  797.  
  798.         guiData.ySize = 0
  799.         guiData.Open = false
  800.         guiData.baseColor = colors.TextDisabled
  801.  
  802.         gui:createList(guiObject, guiData)
  803.         gui:setText(guiObject.Label, data.Name)
  804.         gui:textColorOnHover(guiObject.Label, guiData)
  805.  
  806.         data.callback = newValue
  807.  
  808.         return guiObject
  809.     end
  810.  
  811.     function lib.Checkbox(data, dataArray)
  812.         local guiObject = Checkbox:Clone()
  813.         local Value = gui:unpack(saveData.Options[data.ID].Value, "boolean") or data.Default or false
  814.         local guiData = {}
  815.  
  816.         guiObject.Name = "0"
  817.  
  818.         local newValue = function(val)
  819.             if val == true then else
  820.                 Value = not Value
  821.             end
  822.             if Value then
  823.                 gui.tween(guiObject.Indicator, "Sine", "Out", .35, {Size = UDim2.new(0, 35, 0, 35)})
  824.                 guiData.baseColor = colors.TextEnabled
  825.             else
  826.                 gui.tween(guiObject.Indicator, "Sine", "Out", .35, {Size = UDim2.new(0, 0, 0, 35)})
  827.                 guiData.baseColor = colors.TextDisabled
  828.             end
  829.             if data.Callback then
  830.                 data.Callback(Value)
  831.             end
  832.             saveData.Options[data.ID].Value = gui:pack(Value)
  833.         end
  834.  
  835.         guiObject.Indicator.MouseButton1Down:Connect(newValue)
  836.         guiObject.Label.MouseButton1Down:Connect(newValue)
  837.         newValue(true)
  838.  
  839.         guiData.ySize = 0
  840.         guiData.Open = false
  841.         guiData.baseColor = colors.TextDisabled
  842.  
  843.         gui:createList(guiObject, guiData)
  844.         gui:setText(guiObject.Label, data.Name)
  845.         gui:textColorOnHover(guiObject.Label, guiData)
  846.  
  847.         return guiObject
  848.     end
  849.  
  850.     function lib.Frame(data, dataArray)
  851.         local guiObject = Frame:Clone()
  852.  
  853.         local guiData = {}
  854.         guiData.ySize = 0
  855.         guiData.Open = false
  856.  
  857.         gui:createList(guiObject, guiData)
  858.         gui:setText(guiObject.Label, data.Name)
  859.         gui:textColorOnHover(guiObject.Label, guiData)
  860.  
  861.         return guiObject
  862.     end
  863.  
  864.     function lib.Container(data, dataArray)
  865.         local guiObject = Container:Clone()
  866.  
  867.         guiObject.Position = gui:unpack(saveData.Options[data.ID].Position, "UDim2") or UDim2.new(0, 3, 0, 3 + gui:getn(settingsArray[2]) * 38)
  868.  
  869.         local guiData = {}
  870.         guiData.yPos = 0
  871.         guiData.ySize = 0
  872.         guiData.Open = false
  873.  
  874.         gui:textColorOnHover(guiObject.Title, guiData)
  875.         gui:createList(guiObject, guiData)
  876.         gui:setText(guiObject.Title, data.Name)
  877.         gui:makeDraggable(guiObject, function(x, y)
  878.             guiData.yPos = y
  879.             saveData.Options[data.ID].Position = gui:pack(guiObject.Position)
  880.         end)
  881.  
  882.         return guiObject
  883.     end
  884.  
  885.     -- UI Creation Library
  886.     function gui.create(self, guiType, data)
  887.         if self == gui then
  888.             self = settingsArray
  889.         end
  890.  
  891.         data.ID = data.Name .. "_" .. (self[1].Name or "TOP")
  892.  
  893.         if not saveData.Options[data.ID] then
  894.             saveData.Options[data.ID] = {}
  895.         end
  896.  
  897.         if self[1].Object:FindFirstChild("Dropdown") then
  898.             self[1].Object.Dropdown.Visible = true
  899.         end
  900.  
  901.         local dataArray = {}
  902.         local objectArray = {}
  903.         local selfArray = {dataArray, objectArray, create = gui.create, callback = data.Callback}
  904.         dataArray.Name = data.Name
  905.         dataArray.Data = data
  906.         dataArray.Object = lib[guiType](data, dataArray)
  907.         dataArray.self = selfArray
  908.  
  909.         if guiType == "Toggle" then
  910.             lib.Hotkey(data, dataArray)
  911.         end
  912.         if data.Hint then
  913.             local Object = dataArray.Object
  914.             gui:addHint(Object:FindFirstChild("Title") or Object:FindFirstChild("Label"), data.Hint)
  915.         end
  916.  
  917.         self[1][data.Name] = selfArray
  918.         self[2][data.Name] = dataArray.Object
  919.  
  920.         dataArray.Object.Parent = self[1].Object:FindFirstChild("OptionsFrame") or self[1].Object
  921.  
  922.         return dataArray
  923.     end
  924.  
  925.     -- Connection Stuff
  926.     game:GetService("RunService").RenderStepped:Connect(function()
  927.         for _, func in pairs(connections) do
  928.             func()
  929.         end
  930.     end)
  931.  
  932.     UserInputService.InputBegan:Connect(function(input, gameProcessed)
  933.         if gameProcessed then return end
  934.         for id, key in pairs(saveData.Hotkeys) do
  935.             if key == tostring(input.KeyCode) then
  936.                 hotkeyFunctions[id]()
  937.             end
  938.         end
  939.     end)
  940.  
  941.     Mods.Text = "OpenGui " .. _V
  942.  
  943.     game.Close:Connect(function()
  944.         Save()
  945.     end)
  946.  
  947.     return {gui, saveData, screenGui}
  948. end)()
  949.  
  950. local notify = {Title ="HENTAI", Text ="Got It?", Duration = 120, Button1 = "OK"}
  951. local sound
  952. -- modify esp
  953. local _ESP = (function()
  954.     --// Variables
  955.     local module = {}
  956.  
  957.     local RunService = game:GetService("RunService")
  958.     local Players = game:GetService("Players")
  959.     local Player = Players.LocalPlayer
  960.  
  961.     module.Options = {
  962.         Enabled = false,
  963.         Parent = script.Parent or game.CoreGui,
  964.         Color = Color3.new(1, 0, 0),
  965.         LegendaryOrMagicalShow = true,
  966.         Magical_Color=Color3.new(0, 1, 1),
  967.         Legendary_Color=Color3.new(1, 1, 0),
  968.         Npcs_Color=Color3.new(1, 1, 1),
  969.         MagicalOrLegendary = false,
  970.         Opacity = 1,
  971.         MaxDistance = 25000,
  972.     }
  973.  
  974.     function module:Enable()
  975.         module.Options.Enabled = true
  976.     end
  977.  
  978.     function module:Disable()
  979.         module.Options.Enabled = false
  980.     end
  981.    
  982.     game:GetService("RunService"):BindToRenderStep("ESP",1,function()
  983.         if module.Options.Enabled then
  984.             local shit = workspace.NPCS:GetChildren()
  985.             for i = 1, #shit do
  986.                 local sex = shit[i]
  987.                 local enemy = sex:FindFirstChildOfClass("Model")
  988.                 if enemy and sex:FindFirstChild("Status") and enemy:FindFirstChild("HumanoidRootPart") then
  989.                 --espfunction(sex)
  990.                     local s = sex.Status
  991.                     local box = enemy:FindFirstChild("EGG")
  992.                     if not box then
  993.                         box = Instance.new("BoxHandleAdornment")
  994.                     end
  995.                     box.Size = enemy.HumanoidRootPart.Size
  996.                     box.Name = "EGG"
  997.                     box.Adornee = enemy.HumanoidRootPart
  998.                     box.AlwaysOnTop = true
  999.                     box.ZIndex = 5
  1000.                     box.Transparency = module.Options.Opacity
  1001.                     box.Color3 = module.Options.Color
  1002.                     if sex:FindFirstChild("ChatInfo") then
  1003.                         box.Color3 = module.Options.Npcs_Color
  1004.                     end
  1005.                     if module.Options.MagicalOrLegendary then
  1006.                         if s:FindFirstChild("Legendary") and s.Legendary.Value then
  1007.                             box.Color3 = module.Options.Legendary_Color
  1008.                             if not s.Legendary:FindFirstChild("TAGGED") then
  1009.                                 local Tag=Instance.new("Folder",s.Legendary)
  1010.                                 Tag.Name = "TAGGED"
  1011.                                 notify.Title ="Notification Legendary"
  1012.                                 game:GetService("StarterGui"):SetCore("SendNotification",notify)
  1013.                                 if not sound then
  1014.                                     sound = Instance.new("Sound",game:GetService("CoreGui"))
  1015.                                 end
  1016.                                 sound.SoundId = "rbxassetid://131072261"
  1017.                                 sound.Volume = 10
  1018.                                 sound:Play()
  1019.                             end
  1020.                         elseif s:FindFirstChild("Magical") and s.Magical.Value then
  1021.                             box.Color3 = module.Options.Magical_Color
  1022.                             if not s.Magical:FindFirstChild("TAGGED") then
  1023.                                 local Tag=Instance.new("Folder",s.Magical)
  1024.                                 Tag.Name = "TAGGED"
  1025.                                 notify.Title ="Notification Magical"
  1026.                                 game:GetService("StarterGui"):SetCore("SendNotification",notify)
  1027.                                 if not sound then
  1028.                                     sound = Instance.new("Sound",game:GetService("CoreGui"))
  1029.                                 end
  1030.                                 sound.SoundId = "rbxassetid://130766856"
  1031.                                 sound.Volume = 5
  1032.                                 sound:Play()
  1033.                             end
  1034.                         end
  1035.                     end
  1036.                     box.Parent = enemy
  1037.                     box.Name = "EGG"
  1038.                 end
  1039.             end
  1040.         end
  1041.     end)
  1042.     return module
  1043. end)()
  1044.  
  1045.  
  1046. --// Variables
  1047. local RunService = game:GetService("RunService")
  1048. local HttpService = game:GetService("HttpService")
  1049. local UserInputService = game:GetService("UserInputService")
  1050. local Players = game:GetService("Players")
  1051. local Player = Players.LocalPlayer
  1052. local Mouse = Player:GetMouse()
  1053.  
  1054. local gui = GUIData[1]
  1055. local saveData = GUIData[2]
  1056. local screenGui = GUIData[3]
  1057.  
  1058. local screenscale = 250
  1059. local opacity = 1
  1060. local backcolor = Color3.new()
  1061.  
  1062. --// Saving
  1063. local readfile = readfile or function() end
  1064. pcall(function()
  1065.     local JSONData = readfile("OpenGui.txt")
  1066.     if JSONData then
  1067.         local LUAData = HttpService:JSONDecode(JSONData)
  1068.         saveData.Options = LUAData.Options
  1069.         saveData.Hotkeys = LUAData.Hotkeys
  1070.         print("Save Data found")
  1071.     else
  1072.         print("Save Data not found")
  1073.     end
  1074. end)
  1075.  
  1076.  
  1077. --// UI Creation
  1078.  
  1079. --// Render Frame
  1080. local Render = gui:create("Container", {
  1081.     Name = "Render",
  1082. })--|
  1083. local OpenGui = Render.self:create("Toggle", {
  1084.     Name = "OpenGui",
  1085.     Default = true,
  1086.     Hotkey = tostring(Enum.KeyCode.RightControl),
  1087.     Hint = "The navigation GUI",
  1088.     Callback = function(enabled)
  1089.         for _, frame in pairs(screenGui:GetChildren()) do
  1090.             if frame:IsA("Frame") then
  1091.                 frame.Visible = enabled
  1092.             end
  1093.         end
  1094.         screenGui.Modal.Visible = enabled
  1095.         screenGui.Hint.Visible = false
  1096.     end,
  1097. })--|
  1098. local Opacity = OpenGui.self:create("Number", {
  1099.     Name = "Opacity",
  1100.     Min = 0,
  1101.     Max = 1,
  1102.     Round = 0.01,
  1103.     Default = 0.75,
  1104.     Hint = "Transparency of the navigation GUI",
  1105.     Callback = function(alpha)
  1106.         opacity = 1 - alpha
  1107.         for _, frame in pairs(screenGui:GetChildren()) do
  1108.             if frame:IsA("Frame") then
  1109.                 frame.BackgroundTransparency = 1 - alpha
  1110.                 frame.OptionsFrame.BackgroundTransparency = 1 - alpha
  1111.             end
  1112.         end
  1113.     end,
  1114. })
  1115. local Width = OpenGui.self:create("Number", {
  1116.     Name = "Width",
  1117.     Min = 200,
  1118.     Max = 400,
  1119.     Round = 1,
  1120.     Default = 300,
  1121.     Hint = "Width of the navigation GUI",
  1122.     Callback = function(scale)
  1123.         screenscale = scale
  1124.         for _, frame in pairs(screenGui:GetChildren()) do
  1125.             if frame:IsA("Frame") then
  1126.                 frame.Size = UDim2.new(0, scale, 0, frame.Size.Y.Offset)
  1127.             end
  1128.         end
  1129.     end,
  1130. })
  1131. local Color = OpenGui.self:create("Color", {
  1132.     Name = "Background Color",
  1133.     Default = Color3.fromRGB(40, 40, 40),
  1134.     Hint = "Background color of the navigation GUI",
  1135.     Callback = function(color)
  1136.         backcolor = color
  1137.         for _, frame in pairs(screenGui:GetChildren()) do
  1138.             if frame:IsA("Frame") then
  1139.                 frame.BackgroundColor3 = color
  1140.                 frame.OptionsFrame.BackgroundColor3 = color
  1141.             end
  1142.         end
  1143.     end,
  1144. })
  1145. --[[
  1146. Options = {
  1147.     Enabled = false,
  1148.     Parent = script.Parent or game.CoreGui,
  1149.     Color = Color3.new(1, 0, 0),
  1150.     LegendaryOrMagicalShow = true,
  1151.     Magical_Color=Color3.new(0, 1, 1),
  1152.     Legendary_Color=Color3.new(1, 1, 0),
  1153.     MagicalOrLegendary = false,
  1154.     Opacity = 1,
  1155.     MaxDistance = 25000,
  1156. }
  1157. --]]
  1158. local ESP = Render.self:create("Toggle", {
  1159.     Name = "ESP",
  1160.     Default = false,
  1161.     Hint = "Toggle enemy ESP",
  1162.     Callback = function(enabled)
  1163.         _ESP.Options.Enabled = enabled
  1164.         if enabled then
  1165.             _ESP:Enable()
  1166.         else
  1167.             _ESP:Disable()
  1168.         end
  1169.     end,
  1170. })--|
  1171. local ESPColor = ESP.self:create("Color", {
  1172.     Name = "ESP Color",
  1173.     Default = Color3.new(1, 1, 1),
  1174.     Hint = "Color of the enemy ESP",
  1175.     Callback = function(color)
  1176.         _ESP.Options.Color = color
  1177.     end,
  1178. })
  1179. local ESPNpcsColor = ESP.self:create("Color", {
  1180.     Name = "Npcs Color",
  1181.     Default = Color3.new(1, 1, 1),
  1182.     Hint = "Color of Npcs enemy ESP",
  1183.     Callback = function(color)
  1184.         _ESP.Options.Npcs_Color = color
  1185.     end,
  1186. })
  1187. local ESPShowTeam = ESP.self:create("Checkbox", {
  1188.     Name = "Show Magical/Legendary",
  1189.     Default = false,
  1190.     Hint = "Magical/Legendary are highlighted",
  1191.     Callback = function(enabled)
  1192.         _ESP.Options.MagicalOrLegendary = enabled
  1193.     end,
  1194. })
  1195. local ESPMagicalColor = ESP.self:create("Color", {
  1196.     Name = "Magical Color",
  1197.     Default = Color3.new(0, 1, 1),
  1198.     Hint = "Color of Magical enemy ESP",
  1199.     Callback = function(color)
  1200.         _ESP.Options.Magical_Color = color
  1201.     end,
  1202. })
  1203. local ESPLegendaryColor = ESP.self:create("Color", {
  1204.     Name = "Legendary Color",
  1205.     Default = Color3.new(1, 1, 0),
  1206.     Hint = "Color of Legendary enemy ESP",
  1207.     Callback = function(color)
  1208.         _ESP.Options.Legendary_Color = color
  1209.     end,
  1210. })
  1211. local ESPOpacity = ESP.self:create("Number", {
  1212.     Name = "Opacity",
  1213.     Default = 0.5,
  1214.     Min = 0,
  1215.     Max = 1,
  1216.     Round = 0.001,
  1217.     Hint = "Visibility of the ESP",
  1218.     Callback = function(opacity)
  1219.         _ESP.Options.Opacity = opacity
  1220.     end,
  1221. })
  1222. --// UI Functionality
  1223. RunService.RenderStepped:Connect(function()
  1224.     for _, frame in pairs(screenGui:GetChildren()) do
  1225.         if frame:IsA("Frame") then
  1226.             frame.Size = UDim2.new(0, screenscale, 0, frame.Size.Y.Offset)
  1227.  
  1228.             frame.BackgroundTransparency = opacity
  1229.             frame.OptionsFrame.BackgroundTransparency = opacity
  1230.  
  1231.             frame.BackgroundColor3 = backcolor
  1232.             frame.OptionsFrame.BackgroundColor3 = backcolor
  1233.         end
  1234.     end
  1235. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement