Advertisement
BallTickler420

Noclip Script

Jul 26th, 2024 (edited)
7,845
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.54 KB | Gaming | 1 0
  1. NoClip Roblox Script
  2.  
  3. local player = game.Players.LocalPlayer
  4. local userInputService = game:GetService("UserInputService")
  5. local starterGui = game:GetService("StarterGui")
  6.  
  7. local noClip = false
  8. local dragging = false
  9. local dragStart = nil
  10. local startPos = nil
  11. local guiVisible = true
  12. local screenGui, gearButton, menuGui, noClipButton, speedButton, speedGui
  13. local speedInputBox, applySpeedButton, resetSpeedButton, clickTPButton
  14. local clickTPEnabled = false
  15.  
  16. -- Function to create a Roblox-style notification
  17. local function createNotification(message)
  18.     starterGui:SetCore("SendNotification", {
  19.         Title = "No-Clip";
  20.         Text = message;
  21.         Duration = 2; -- Duration of the notification
  22.     })
  23. end
  24.  
  25. -- Function to apply No-Clip to the character
  26. local function applyNoClip(character)
  27.     if not character then return end
  28.     for _, part in pairs(character:GetDescendants()) do
  29.         if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
  30.             part.CanCollide = not noClip
  31.         end
  32.     end
  33.     if character:FindFirstChild("HumanoidRootPart") then
  34.         character.HumanoidRootPart.CanCollide = not noClip
  35.     end
  36. end
  37.  
  38. -- Function to enable/disable No-Clip mode
  39. local function setNoClip(enabled)
  40.     noClip = enabled
  41.     applyNoClip(player.Character)
  42.     if noClipButton then
  43.         noClipButton.Text = "No-Clip: " .. (noClip and "Enabled" or "Disabled")
  44.         noClipButton.BackgroundColor3 = noClip and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0)
  45.     end
  46.     print("No-Clip " .. (noClip and "Enabled" or "Disabled"))
  47. end
  48.  
  49. -- Function to toggle No-Clip mode
  50. function toggleNoClip()
  51.     setNoClip(not noClip)
  52. end
  53.  
  54. -- Function to start dragging
  55. local function startDragging(input)
  56.     if input.UserInputType == Enum.UserInputType.MouseButton1 and input.Target.Parent == menuGui then
  57.         dragging = true
  58.         dragStart = input.Position
  59.         startPos = menuGui.Position
  60.     end
  61. end
  62.  
  63. -- Function to stop dragging
  64. local function stopDragging()
  65.     dragging = false
  66. end
  67.  
  68. -- Function to update dragging position
  69. local function updateDragging(input)
  70.     if dragging then
  71.         local delta = input.Position - dragStart
  72.         menuGui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  73.     end
  74. end
  75.  
  76. -- GUI Setup
  77. local function createGui()
  78.     if screenGui then screenGui:Destroy() end
  79.     screenGui = Instance.new("ScreenGui")
  80.     screenGui.Name = "NoClipGUI"
  81.     screenGui.Parent = player:WaitForChild("PlayerGui")
  82.  
  83.     -- Gear Button Setup
  84.     gearButton = Instance.new("ImageButton")
  85.     gearButton.Size = UDim2.new(0, 30, 0, 30)
  86.     gearButton.Position = UDim2.new(0, 10, 0, 10)
  87.     gearButton.Image = "rbxassetid://6031091005"
  88.     gearButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  89.     gearButton.BorderSizePixel = 2
  90.     gearButton.BorderColor3 = Color3.fromRGB(255, 255, 0)
  91.     gearButton.Parent = screenGui
  92.     gearButton.MouseButton1Click:Connect(function()
  93.         menuGui.Visible = not menuGui.Visible
  94.         if speedGui then
  95.             speedGui.Visible = false -- Close Speed GUI when the gear button is clicked
  96.         end
  97.     end)
  98.  
  99.     -- Menu GUI Setup
  100.     menuGui = Instance.new("Frame")
  101.     menuGui.Size = UDim2.new(0, 200, 0, 150)
  102.     menuGui.Position = UDim2.new(0, 50, 0, 10)
  103.     menuGui.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  104.     menuGui.BackgroundTransparency = 0.5
  105.     menuGui.Visible = false
  106.     menuGui.Parent = screenGui
  107.  
  108.     -- No-Clip Button Setup
  109.     noClipButton = Instance.new("TextButton")
  110.     noClipButton.Size = UDim2.new(1, 0, 0, 50)
  111.     noClipButton.Position = UDim2.new(0, 0, 0, 0)
  112.     noClipButton.Text = "No-Clip: Disabled"
  113.     noClipButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  114.     noClipButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  115.     noClipButton.BorderSizePixel = 2
  116.     noClipButton.BorderColor3 = Color3.fromRGB(255, 255, 0)
  117.     noClipButton.TextScaled = true
  118.     noClipButton.Font = Enum.Font.SourceSansBold
  119.     noClipButton.Parent = menuGui
  120.     noClipButton.MouseButton1Click:Connect(toggleNoClip)
  121.  
  122.     -- Speed Button Setup
  123.     speedButton = Instance.new("TextButton")
  124.     speedButton.Size = UDim2.new(1, 0, 0, 50)
  125.     speedButton.Position = UDim2.new(0, 0, 0, 60)
  126.     speedButton.Text = "Speed"
  127.     speedButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  128.     speedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  129.     speedButton.BorderSizePixel = 2
  130.     speedButton.BorderColor3 = Color3.fromRGB(255, 255, 0)
  131.     speedButton.TextScaled = true
  132.     speedButton.Font = Enum.Font.SourceSansBold
  133.     speedButton.Parent = menuGui
  134.     speedButton.MouseButton1Click:Connect(function()
  135.         speedGui.Visible = not speedGui.Visible
  136.     end)
  137.  
  138.     -- Speed GUI Setup
  139.     speedGui = Instance.new("Frame")
  140.     speedGui.Size = UDim2.new(0, 200, 0, 150)
  141.     speedGui.Position = UDim2.new(0, 50, 0, 170)
  142.     speedGui.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  143.     speedGui.BackgroundTransparency = 0.5
  144.     speedGui.Visible = false
  145.     speedGui.Parent = screenGui
  146.  
  147.     -- Speed Input Box
  148.     speedInputBox = Instance.new("TextBox")
  149.     speedInputBox.Size = UDim2.new(1, 0, 0, 40)
  150.     speedInputBox.Position = UDim2.new(0, 0, 0, 10)
  151.     speedInputBox.PlaceholderText = "Enter Speed"
  152.     speedInputBox.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  153.     speedInputBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  154.     speedInputBox.BorderSizePixel = 2
  155.     speedInputBox.BorderColor3 = Color3.fromRGB(255, 255, 0)
  156.     speedInputBox.TextScaled = true
  157.     speedInputBox.Font = Enum.Font.SourceSansBold
  158.     speedInputBox.Parent = speedGui
  159.  
  160.     -- Apply Speed Button
  161.     applySpeedButton = Instance.new("TextButton")
  162.     applySpeedButton.Size = UDim2.new(1, 0, 0, 40)
  163.     applySpeedButton.Position = UDim2.new(0, 0, 0, 60)
  164.     applySpeedButton.Text = "Apply Speed"
  165.     applySpeedButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  166.     applySpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  167.     applySpeedButton.BorderSizePixel = 2
  168.     applySpeedButton.BorderColor3 = Color3.fromRGB(255, 255, 0)
  169.     applySpeedButton.TextScaled = true
  170.     applySpeedButton.Font = Enum.Font.SourceSansBold
  171.     applySpeedButton.Parent = speedGui
  172.     applySpeedButton.MouseButton1Click:Connect(function()
  173.         local speedValue = tonumber(speedInputBox.Text)
  174.         if speedValue then
  175.             player.Character.Humanoid.WalkSpeed = speedValue
  176.         end
  177.     end)
  178.  
  179.     -- Reset Speed Button
  180.     resetSpeedButton = Instance.new("TextButton")
  181.     resetSpeedButton.Size = UDim2.new(1, 0, 0, 40)
  182.     resetSpeedButton.Position = UDim2.new(0, 0, 0, 110)
  183.     resetSpeedButton.Text = "Reset Speed"
  184.     resetSpeedButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  185.     resetSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  186.     resetSpeedButton.BorderSizePixel = 2
  187.     resetSpeedButton.BorderColor3 = Color3.fromRGB(255, 255, 0)
  188.     resetSpeedButton.TextScaled = true
  189.     resetSpeedButton.Font = Enum.Font.SourceSansBold
  190.     resetSpeedButton.Parent = speedGui
  191.     resetSpeedButton.MouseButton1Click:Connect(function()
  192.         player.Character.Humanoid.WalkSpeed = 16 -- Default speed value
  193.     end)
  194.  
  195.     -- Click TP Button Setup
  196.     clickTPButton = Instance.new("TextButton")
  197.     clickTPButton.Size = UDim2.new(1, 0, 0, 50)
  198.     clickTPButton.Position = UDim2.new(0, 0, 0, 120)
  199.     clickTPButton.Text = "Click TP: Disabled"
  200.     clickTPButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  201.     clickTPButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  202.     clickTPButton.BorderSizePixel = 2
  203.     clickTPButton.BorderColor3 = Color3.fromRGB(255, 255, 0)
  204.     clickTPButton.TextScaled = true
  205.     clickTPButton.Font = Enum.Font.SourceSansBold
  206.     clickTPButton.Parent = menuGui
  207.     clickTPButton.MouseButton1Click:Connect(function()
  208.         clickTPEnabled = not clickTPEnabled
  209.         clickTPButton.Text = "Click TP: " .. (clickTPEnabled and "Enabled" or "Disabled")
  210.         createNotification("Click TP " .. (clickTPEnabled and "Enabled" or "Disabled"))
  211.     end)
  212. end
  213.  
  214. -- Function to handle input for toggling GUI visibility
  215. local function onInputBegan(input)
  216.     if input.KeyCode == Enum.KeyCode.U then
  217.         guiVisible = not guiVisible
  218.         if guiVisible then
  219.             createGui()
  220.         else
  221.             if screenGui then screenGui:Destroy() end
  222.         end
  223.     end
  224. end
  225.  
  226. -- Function to handle Click TP
  227. local function onClickTP(input)
  228.     if clickTPEnabled and input.UserInputType == Enum.UserInputType.MouseButton1 then
  229.         local mousePosition = userInputService:GetMouseLocation()
  230.         local targetPosition = workspace.CurrentCamera:ScreenToWorldPoint(Vector3.new(mousePosition.X, mousePosition.Y, 0))
  231.         player.Character.HumanoidRootPart.CFrame = CFrame.new(targetPosition)
  232.     end
  233. end
  234.  
  235. -- Connect input events
  236. userInputService.InputBegan:Connect(onInputBegan)
  237. userInputService.InputBegan:Connect(startDragging)
  238. userInputService.InputEnded:Connect(stopDragging)
  239. userInputService.InputChanged:Connect(updateDragging)
  240. userInputService.InputBegan:Connect(onClickTP) -- Connect Click TP
  241.  
  242. -- Show notification for running the script
  243. createNotification("GUI script loaded")
  244. createGui() -- Initial creation of GUI
  245.  
  246. -- Monitor player character for No-Clip application
  247. player.CharacterAdded:Connect(function(character)
  248.     character.DescendantAdded:Connect(function(descendant)
  249.         if noClip and descendant:IsA("BasePart") and descendant.Name ~= "HumanoidRootPart" then
  250.             descendant.CanCollide = false
  251.         end
  252.     end)
  253.     applyNoClip(character)
  254. end)
  255.  
  256.  
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement