Advertisement
kill21_2

скрипт на удаления

May 23rd, 2025 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.60 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local UserInputService = game:GetService("UserInputService")
  3.  
  4. local player = Players.LocalPlayer
  5. local gui = Instance.new("ScreenGui")
  6. gui.Name = "FileDeleterGUI"
  7. gui.ResetOnSpawn = false
  8. gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  9. gui.Parent = player:WaitForChild("PlayerGui")
  10.  
  11. -- Основной фрейм
  12. local mainFrame = Instance.new("Frame")
  13. mainFrame.Name = "MainFrame"
  14. mainFrame.Size = UDim2.new(0, 350, 0, 250)
  15. mainFrame.Position = UDim2.new(0.5, -175, 0.5, -125)
  16. mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  17. mainFrame.BackgroundColor3 = Color3.fromRGB(18, 18, 18)
  18. mainFrame.BorderColor3 = Color3.fromRGB(75, 0, 130)
  19. mainFrame.BorderSizePixel = 2
  20. mainFrame.Parent = gui
  21.  
  22. -- Заголовок
  23. local title = Instance.new("TextLabel")
  24. title.Name = "Title"
  25. title.Size = UDim2.new(1, 0, 0, 40)
  26. title.Position = UDim2.new(0, 0, 0, 0)
  27. title.BackgroundColor3 = Color3.fromRGB(30, 0, 50)
  28. title.BorderSizePixel = 0
  29. title.Text = "OBJECT DELETER"
  30. title.TextColor3 = Color3.fromRGB(200, 180, 255)
  31. title.Font = Enum.Font.GothamBold
  32. title.TextSize = 18
  33. title.Parent = mainFrame
  34.  
  35. -- Поле для ввода
  36. local inputBox = Instance.new("TextBox")
  37. inputBox.Name = "InputBox"
  38. inputBox.Size = UDim2.new(0.9, 0, 0, 35)
  39. inputBox.Position = UDim2.new(0.05, 0, 0.2, 0)
  40. inputBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  41. inputBox.BorderColor3 = Color3.fromRGB(100, 0, 180)
  42. inputBox.TextColor3 = Color3.fromRGB(220, 220, 220)
  43. inputBox.PlaceholderText = "Введите имя объекта/модели..."
  44. inputBox.Font = Enum.Font.Gotham
  45. inputBox.TextSize = 14
  46. inputBox.Parent = mainFrame
  47.  
  48. -- Кнопка удаления
  49. local deleteButton = Instance.new("TextButton")
  50. deleteButton.Name = "DeleteButton"
  51. deleteButton.Size = UDim2.new(0.9, 0, 0, 35)
  52. deleteButton.Position = UDim2.new(0.05, 0, 0.4, 0)
  53. deleteButton.BackgroundColor3 = Color3.fromRGB(80, 0, 120)
  54. deleteButton.BorderSizePixel = 0
  55. deleteButton.Text = "УДАЛИТЬ ОБЪЕКТ"
  56. deleteButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  57. deleteButton.Font = Enum.Font.GothamBold
  58. deleteButton.TextSize = 14
  59. deleteButton.Parent = mainFrame
  60.  
  61. -- Эффект при наведении на кнопку
  62. deleteButton.MouseEnter:Connect(function()
  63. deleteButton.BackgroundColor3 = Color3.fromRGB(120, 0, 180)
  64. end)
  65.  
  66. deleteButton.MouseLeave:Connect(function()
  67. deleteButton.BackgroundColor3 = Color3.fromRGB(80, 0, 120)
  68. end)
  69.  
  70. -- Кнопка копирования скрипта
  71. local copyScriptButton = Instance.new("TextButton")
  72. copyScriptButton.Name = "CopyScriptButton"
  73. copyScriptButton.Size = UDim2.new(0.9, 0, 0, 35)
  74. copyScriptButton.Position = UDim2.new(0.05, 0, 0.55, 0)
  75. copyScriptButton.BackgroundColor3 = Color3.fromRGB(50, 0, 80)
  76. copyScriptButton.BorderSizePixel = 0
  77. copyScriptButton.Text = "КОПИРОВАТЬ СКРИПТ"
  78. copyScriptButton.TextColor3 = Color3.fromRGB(200, 180, 255)
  79. copyScriptButton.Font = Enum.Font.GothamBold
  80. copyScriptButton.TextSize = 14
  81. copyScriptButton.Parent = mainFrame
  82.  
  83. -- Эффект при наведении на кнопку
  84. copyScriptButton.MouseEnter:Connect(function()
  85. copyScriptButton.BackgroundColor3 = Color3.fromRGB(80, 0, 130)
  86. end)
  87.  
  88. copyScriptButton.MouseLeave:Connect(function()
  89. copyScriptButton.BackgroundColor3 = Color3.fromRGB(50, 0, 80)
  90. end)
  91.  
  92. -- Кнопка закрытия
  93. local closeButton = Instance.new("TextButton")
  94. closeButton.Name = "CloseButton"
  95. closeButton.Size = UDim2.new(0, 30, 0, 30)
  96. closeButton.Position = UDim2.new(1, -35, 0, 5)
  97. closeButton.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
  98. closeButton.BorderSizePixel = 0
  99. closeButton.Text = "X"
  100. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  101. closeButton.Font = Enum.Font.GothamBold
  102. closeButton.TextSize = 16
  103. closeButton.Parent = mainFrame
  104.  
  105. -- Эффект при наведении на кнопку
  106. closeButton.MouseEnter:Connect(function()
  107. closeButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
  108. end)
  109.  
  110. closeButton.MouseLeave:Connect(function()
  111. closeButton.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
  112. end)
  113.  
  114. -- Функционал кнопок
  115. deleteButton.MouseButton1Click:Connect(function()
  116. local objectName = inputBox.Text
  117. if objectName == "" then
  118. game:GetService("StarterGui"):SetCore("SendNotification", {
  119. Title = "Ошибка",
  120. Text = "Введите имя объекта!",
  121. Duration = 3
  122. })
  123. return
  124. end
  125.  
  126. -- Поиск и удаление объекта в Workspace
  127. local found = false
  128. for _, obj in ipairs(workspace:GetDescendants()) do
  129. if obj.Name == objectName then
  130. obj:Destroy()
  131. found = true
  132. end
  133. end
  134.  
  135. if found then
  136. game:GetService("StarterGui"):SetCore("SendNotification", {
  137. Title = "Успешно",
  138. Text = "Объект '"..objectName.."' удален!",
  139. Duration = 3
  140. })
  141. else
  142. game:GetService("StarterGui"):SetCore("SendNotification", {
  143. Title = "Ошибка",
  144. Text = "Объект '"..objectName.."' не найден!",
  145. Duration = 3
  146. })
  147. end
  148.  
  149. inputBox.Text = ""
  150. end)
  151.  
  152. copyScriptButton.MouseButton1Click:Connect(function()
  153. local objectName = inputBox.Text
  154. if objectName == "" then
  155. game:GetService("StarterGui"):SetCore("SendNotification", {
  156. Title = "Ошибка",
  157. Text = "Введите имя объекта перед копированием!",
  158. Duration = 3
  159. })
  160. return
  161. end
  162.  
  163. local scriptToCopy = string.format([[
  164. -- Скрипт для удаления объекта '%s' в Roblox
  165. local objectName = "%s"
  166.  
  167. local function deleteObject(name)
  168. local found = false
  169. for _, obj in ipairs(workspace:GetDescendants()) do
  170. if obj.Name == name then
  171. obj:Destroy()
  172. found = true
  173. end
  174. end
  175.  
  176. if found then
  177. print("Объект '"..name.."' успешно удален")
  178. else
  179. warn("Объект '"..name.."' не найден!")
  180. end
  181. end
  182.  
  183. deleteObject(objectName)
  184. ]], objectName, objectName)
  185.  
  186. setclipboard(scriptToCopy)
  187.  
  188. game:GetService("StarterGui"):SetCore("SendNotification", {
  189. Title = "Скрипт скопирован",
  190. Text = "Скрипт для удаления '"..objectName.."' в буфере обмена",
  191. Duration = 3
  192. })
  193. end)
  194.  
  195. closeButton.MouseButton1Click:Connect(function()
  196. gui:Destroy()
  197. end)
  198.  
  199. -- Функционал перемещения окна
  200. local dragging
  201. local dragInput
  202. local dragStart
  203. local startPos
  204.  
  205. local function update(input)
  206. local delta = input.Position - dragStart
  207. mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  208. end
  209.  
  210. title.InputBegan:Connect(function(input)
  211. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  212. dragging = true
  213. dragStart = input.Position
  214. startPos = mainFrame.Position
  215.  
  216. input.Changed:Connect(function()
  217. if input.UserInputState == Enum.UserInputState.End then
  218. dragging = false
  219. end
  220. end)
  221. end
  222. end)
  223.  
  224. title.InputChanged:Connect(function(input)
  225. if input.UserInputType == Enum.UserInputType.MouseMovement then
  226. dragInput = input
  227. end
  228. end)
  229.  
  230. UserInputService.InputChanged:Connect(function(input)
  231. if input == dragInput and dragging then
  232. update(input)
  233. end
  234. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement