Advertisement
Mautiku

3D Gui toggled

Apr 17th, 2025 (edited)
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.04 KB | Gaming | 0 0
  1. --========3D guis toggled========
  2. -- Type "/e rg" to remove the toggled gui
  3. -- rg means Remove gui btw
  4. -- The "/e d<nunber>"  its kinda buggy i'll try to fix it if i got time
  5. -- d<number> means drag with numbers example like d10 it would give you 10 seconds to lets you drag
  6. -- SussyXDDDDdDDdDDDD
  7. --[[ YOU CAN USE THIS LOADSTRING TOO RIGHT HERE
  8.  
  9. _G.ToggleKeybind = Enum.KeyCode.F
  10. loadstring(game:HttpGet("https://pastebin.com/raw/hR2R1hu1"))()
  11.  
  12. — So that was a loadstring if you want to change the key i bet you already know how to do that
  13.  
  14. YT:
  15. ░██████╗██╗░░░██╗░██████╗░██████╗██╗░░░██╗
  16. ██╔════╝██║░░░██║██╔════╝██╔════╝╚██╗░██╔╝
  17. ╚█████╗░██║░░░██║╚█████╗░╚█████╗░░╚████╔╝░
  18. ░╚═══██╗██║░░░██║░╚═══██╗░╚═══██╗░░╚██╔╝░░
  19. ██████╔╝╚██████╔╝██████╔╝██████╔╝░░░██║░░░
  20. ╚═════╝░░╚═════╝░╚═════╝░╚═════╝░░░░╚═╝░░░
  21. ██╗░░██╗██████╗░██████╗░
  22. ╚██╗██╔╝██╔══██╗██╔══██╗
  23. ░╚███╔╝░██║░░██║██║░░██║
  24. ░██╔██╗░██║░░██║██║░░██║
  25. ██╔╝╚██╗██████╔╝██████╔╝
  26. ╚═╝░░╚═╝╚═════╝░╚═════╝░
  27.  
  28. ]]
  29.  
  30. local player = game.Players.LocalPlayer
  31. local userInput = game:GetService("UserInputService")
  32. local runService = game:GetService("RunService")
  33. local tweenService = game:GetService("TweenService")
  34.  
  35. --======= CHANGE YOUr KEYBIND HERE =======--
  36. local toggleKey = _G.ToggleKeybind or Enum.KeyCode.F
  37.  
  38. local function createGui()
  39.     local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  40.     gui.Name = "FloatingGuiToggle"
  41.     gui.ResetOnSpawn = false
  42.  
  43.     local toggleButton = Instance.new("TextButton")
  44.     toggleButton.Size = UDim2.new(0, 120, 0, 40)
  45.     toggleButton.Position = UDim2.new(1, -130, 0, 20)
  46.     toggleButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  47.     toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  48.     toggleButton.Text = "Hide 3D GUI"
  49.     toggleButton.Font = Enum.Font.GothamBold
  50.     toggleButton.TextScaled = true
  51.     toggleButton.BackgroundTransparency = 0
  52.     toggleButton.TextTransparency = 0
  53.     toggleButton.Parent = gui
  54.     Instance.new("UICorner", toggleButton).CornerRadius = UDim.new(0, 12)
  55.  
  56.     local isVisible = true
  57.     local dragging = false
  58.     local holding = false
  59.     local dragOffset = Vector2.new()
  60.     local startTime = 0
  61.     local countdownTime = 0
  62.     local countdownRunning = false
  63.  
  64.     local function toggle3DGui()
  65.         isVisible = not isVisible
  66.         toggleButton.Text = isVisible and "Hide 3D GUI" or "Show 3D GUI"
  67.  
  68.         for _, part in ipairs(workspace:GetChildren()) do
  69.             if part:IsA("Part") and part:FindFirstChildWhichIsA("SurfaceGui") then
  70.                 part.Transparency = isVisible and 0.8 or 1
  71.                 part.CanCollide = isVisible
  72.                 for _, sg in ipairs(part:GetChildren()) do
  73.                     if sg:IsA("SurfaceGui") then
  74.                         sg.Enabled = isVisible
  75.                     end
  76.                 end
  77.             end
  78.         end
  79.     end
  80.  
  81.     toggleButton.InputBegan:Connect(function(input)
  82.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  83.             startTime = tick()
  84.             holding = true
  85.             dragOffset = input.Position - toggleButton.AbsolutePosition
  86.  
  87.             local conn
  88.             conn = runService.RenderStepped:Connect(function()
  89.                 if not holding then conn:Disconnect() return end
  90.                 if tick() - startTime >= 0.3 and not dragging then
  91.                     dragging = true
  92.                     toggleButton.BackgroundColor3 = Color3.fromRGB(50, 50, 255)
  93.                 end
  94.             end)
  95.         end
  96.     end)
  97.  
  98.     userInput.InputChanged:Connect(function(input)
  99.         if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  100.             local pos = input.Position - dragOffset
  101.             toggleButton.Position = UDim2.new(0, pos.X, 0, pos.Y)
  102.         end
  103.     end)
  104.  
  105.     toggleButton.InputEnded:Connect(function(input)
  106.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  107.             if dragging then
  108.                 dragging = false
  109.                 toggleButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  110.             elseif tick() - startTime < 0.3 then
  111.                 toggle3DGui()
  112.             end
  113.             holding = false
  114.         end
  115.     end)
  116.  
  117.     userInput.InputBegan:Connect(function(input, gameProcessed)
  118.         if gameProcessed then return end
  119.         if input.KeyCode == toggleKey then
  120.             toggle3DGui()
  121.         end
  122.     end)
  123.  
  124.     player.Chatted:Connect(function(msg)
  125.         if msg:lower() == "/e rg" and gui and gui.Parent then
  126.             toggleButton.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  127.             toggleButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  128.             toggleButton.Text = "2"
  129.  
  130.             for i = 2, 1, -1 do
  131.                 toggleButton.Text = tostring(i)
  132.                 wait(1)
  133.             end
  134.  
  135.             local tween = tweenService:Create(toggleButton, TweenInfo.new(0.6), {
  136.                 BackgroundTransparency = 1,
  137.                 TextTransparency = 1
  138.             })
  139.             tween:Play()
  140.             tween.Completed:Wait()
  141.             gui:Destroy()
  142.         end
  143.     end)
  144.  
  145.     player.Chatted:Connect(function(msg)
  146.         if msg:lower():match("^/e d(%d+)$") then
  147.             local num = tonumber(msg:match("^/e d(%d+)$"))
  148.             if num then
  149.                 toggleButton.BackgroundColor3 = Color3.fromRGB(0, 0, 255)
  150.                 toggleButton.Text = tostring(num)
  151.  
  152.                 countdownTime = num
  153.                 countdownRunning = true
  154.                 dragging = true
  155.  
  156.                 for i = countdownTime, 1, -1 do
  157.                     if not countdownRunning then break end
  158.                     toggleButton.Text = tostring(i)
  159.                     wait(1)
  160.                 end
  161.  
  162.                 countdownRunning = false
  163.                 dragging = false
  164.                 toggleButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  165.                 toggleButton.Text = "Hide 3D GUI"
  166.             end
  167.         end
  168.     end)
  169. end
  170.  
  171. createGui()
  172. task.wait(1)
  173. player:Chat("/e reload")
  174. player:Chat("/e reload")
  175.  
  176. player.Chatted:Connect(function(msg)
  177.     if msg:lower() == "/e reg" then
  178.         if not player:FindFirstChild("PlayerGui"):FindFirstChild("FloatingGuiToggle") then
  179.             local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  180.             gui.Name = "FloatingGuiToggle"
  181.             gui.ResetOnSpawn = false
  182.  
  183.             local btn = Instance.new("TextButton")
  184.             btn.Size = UDim2.new(0, 120, 0, 40)
  185.             btn.Position = UDim2.new(1, -130, 0, 20)
  186.             btn.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  187.             btn.TextColor3 = Color3.fromRGB(255, 255, 255)
  188.             btn.Text = "..."
  189.             btn.Font = Enum.Font.GothamBold
  190.             btn.TextScaled = true
  191.             btn.BackgroundTransparency = 1
  192.             btn.TextTransparency = 1
  193.             btn.Parent = gui
  194.             Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 12)
  195.  
  196.             local tween = tweenService:Create(btn, TweenInfo.new(0.6), {
  197.                 BackgroundTransparency = 0,
  198.                 TextTransparency = 0,
  199.             })
  200.             tween:Play()
  201.             tween.Completed:Wait()
  202.  
  203.             btn:Destroy()
  204.             createGui()
  205.         end
  206.     end
  207. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement