QJL_RbxScriptsGROUP

Ye

Nov 1st, 2025
295
0
364 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.67 KB | Source Code | 0 0
  1. -- Скрипт для ServerScriptService или StarterPlayerScripts
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local UserInputService = game:GetService("UserInputService")
  5. local TweenService = game:GetService("TweenService")
  6.  
  7. local player = Players.LocalPlayer
  8. local character = player.CharacterAdded:Wait()
  9. local humanoid = character:WaitForChild("Humanoid")
  10.  
  11. -- Создание GUI
  12. local screenGui = Instance.new("ScreenGui")
  13. screenGui.Name = "NoClipGUI"
  14. screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  15. screenGui.Parent = player.PlayerGui
  16.  
  17. -- Основной фрейм
  18. local mainFrame = Instance.new("Frame")
  19. mainFrame.Name = "MainFrame"
  20. mainFrame.Size = UDim2.new(0, 200, 0, 120)
  21. mainFrame.Position = UDim2.new(0, 10, 0, 10)
  22. mainFrame.BackgroundColor3 = Color3.new(0, 0, 0)
  23. mainFrame.BorderSizePixel = 2
  24. mainFrame.BorderColor3 = Color3.new(1, 0.5, 0)
  25. mainFrame.Active = true
  26. mainFrame.Draggable = false -- Мы реализуем перетаскивание самостоятельно
  27. mainFrame.Parent = screenGui
  28.  
  29. -- Заголовок
  30. local titleLabel = Instance.new("TextLabel")
  31. titleLabel.Name = "TitleLabel"
  32. titleLabel.Size = UDim2.new(1, 0, 0, 30)
  33. titleLabel.Position = UDim2.new(0, 0, 0, 0)
  34. titleLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  35. titleLabel.BorderSizePixel = 0
  36. titleLabel.Text = "QJL RbxScripts"
  37. titleLabel.TextColor3 = Color3.new(1, 0.5, 0)
  38. titleLabel.TextScaled = true
  39. titleLabel.Font = Enum.Font.GothamBold
  40. titleLabel.Parent = mainFrame
  41.  
  42. -- Кнопка NoClip
  43. local noClipButton = Instance.new("TextButton")
  44. noClipButton.Name = "NoClipButton"
  45. noClipButton.Size = UDim2.new(0.8, 0, 0, 40)
  46. noClipButton.Position = UDim2.new(0.1, 0, 0.4, 0)
  47. noClipButton.BackgroundColor3 = Color3.new(1, 0.5, 0)
  48. noClipButton.BorderSizePixel = 0
  49. noClipButton.Text = "NOCLIP OFF"
  50. noClipButton.TextColor3 = Color3.new(0, 0, 0)
  51. noClipButton.TextScaled = true
  52. noClipButton.Font = Enum.Font.GothamBold
  53. noClipButton.Parent = mainFrame
  54.  
  55. -- Переменные для состояния
  56. local noClipEnabled = false
  57. local noClipConnection = nil
  58. local isDragging = false
  59. local dragStart = nil
  60. local frameStart = nil
  61.  
  62. -- Функция для перетаскивания GUI
  63. local function onInputBegan(input, gameProcessed)
  64.     if gameProcessed then return end
  65.    
  66.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  67.         local mousePos = input.Position
  68.         local framePos = mainFrame.AbsolutePosition
  69.         local frameSize = mainFrame.AbsoluteSize
  70.        
  71.         -- Проверяем, находится ли клик внутри фрейма
  72.         if mousePos.X >= framePos.X and mousePos.X <= framePos.X + frameSize.X and
  73.            mousePos.Y >= framePos.Y and mousePos.Y <= framePos.Y + frameSize.Y then
  74.             isDragging = true
  75.             dragStart = mousePos
  76.             frameStart = mainFrame.Position
  77.            
  78.             -- Визуальная обратная связь при перетаскивании
  79.             local tween = TweenService:Create(mainFrame, TweenInfo.new(0.1), {BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)})
  80.             tween:Play()
  81.         end
  82.     end
  83. end
  84.  
  85. local function onInputChanged(input, gameProcessed)
  86.     if gameProcessed then return end
  87.    
  88.     if isDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  89.         local delta = input.Position - dragStart
  90.         local newPosition = UDim2.new(
  91.             frameStart.X.Scale,
  92.             frameStart.X.Offset + delta.X,
  93.             frameStart.Y.Scale,
  94.             frameStart.Y.Offset + delta.Y
  95.         )
  96.         mainFrame.Position = newPosition
  97.     end
  98. end
  99.  
  100. local function onInputEnded(input, gameProcessed)
  101.     if gameProcessed then return end
  102.    
  103.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  104.         if isDragging then
  105.             isDragging = false
  106.            
  107.             -- Возвращаем обычный цвет
  108.             local tween = TweenService:Create(mainFrame, TweenInfo.new(0.1), {BackgroundColor3 = Color3.new(0, 0, 0)})
  109.             tween:Play()
  110.         end
  111.     end
  112. end
  113.  
  114. -- Подключаем обработчики для перетаскивания
  115. UserInputService.InputBegan:Connect(onInputBegan)
  116. UserInputService.InputChanged:Connect(onInputChanged)
  117. UserInputService.InputEnded:Connect(onInputEnded)
  118.  
  119. -- Функция NoClip
  120. local function updateNoClip()
  121.     if character and humanoid then
  122.         for _, part in pairs(character:GetDescendants()) do
  123.             if part:IsA("BasePart") and part.CanCollide then
  124.                 part.CanCollide = not noClipEnabled
  125.             end
  126.         end
  127.     end
  128. end
  129.  
  130. -- Обработчик переключения NoClip
  131. noClipButton.MouseButton1Click:Connect(function()
  132.     noClipEnabled = not noClipEnabled
  133.    
  134.     if noClipEnabled then
  135.         noClipButton.Text = "NOCLIP ON"
  136.         -- Анимация при включении
  137.         local tween = TweenService:Create(noClipButton, TweenInfo.new(0.2), {BackgroundColor3 = Color3.new(0, 1, 0)})
  138.         tween:Play()
  139.     else
  140.         noClipButton.Text = "NOCLIP OFF"
  141.         -- Возвращаем оранжевый цвет
  142.         local tween = TweenService:Create(noClipButton, TweenInfo.new(0.2), {BackgroundColor3 = Color3.new(1, 0.5, 0)})
  143.         tween:Play()
  144.     end
  145.    
  146.     updateNoClip()
  147. end)
  148.  
  149. -- Постоянное обновление NoClip (на случай респавна персонажа)
  150. if noClipConnection then
  151.     noClipConnection:Disconnect()
  152. end
  153.  
  154. noClipConnection = RunService.Stepped:Connect(function()
  155.     if noClipEnabled and character then
  156.         updateNoClip()
  157.     end
  158. end)
  159.  
  160. -- Обработчик респавна персонажа
  161. player.CharacterAdded:Connect(function(newCharacter)
  162.     character = newCharacter
  163.     humanoid = character:WaitForChild("Humanoid")
  164.    
  165.     -- Сбрасываем NoClip при респавне
  166.     if noClipEnabled then
  167.         noClipEnabled = false
  168.         noClipButton.Text = "NOCLIP OFF"
  169.         local tween = TweenService:Create(noClipButton, TweenInfo.new(0.2), {BackgroundColor3 = Color3.new(1, 0.5, 0)})
  170.         tween:Play()
  171.     end
  172. end)
  173.  
  174. -- Анимация появления
  175. mainFrame.Size = UDim2.new(0, 0, 0, 0)
  176. local appearTween = TweenService:Create(mainFrame, TweenInfo.new(0.5), {Size = UDim2.new(0, 200, 0, 120)})
  177. appearTween:Play()
  178.  
  179. print("NoClip GUI загружен! Перетаскивайте окно для перемещения.")
Advertisement
Add Comment
Please, Sign In to add comment