zumhad

Gui By Zumhad

Feb 25th, 2025 (edited)
2,604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.93 KB | Source Code | 0 0
  1. local ScreenGui = Instance.new("ScreenGui")
  2. local Frame = Instance.new("Frame")
  3. local UICorner = Instance.new("UICorner")
  4. local CloseButton = Instance.new("TextButton")
  5. local MinimizeButton = Instance.new("TextButton")
  6. local UserInputService = game:GetService("UserInputService")
  7. local TweenService = game:GetService("TweenService")
  8. local isMinimized = false
  9. local isFollowMenuOpen = false
  10. local isFollowing = false
  11. local isCollecting = false
  12. local isAutoCoinSettingsOpen = false
  13. local currentCoin = nil
  14. local isMovingToCoin = false
  15. local currentTarget = nil
  16.  
  17. local UserInputService = game:GetService("UserInputService")
  18. local RunService = game:GetService("RunService")
  19.  
  20. local Player = game.Players.LocalPlayer
  21. local Mouse = Player:GetMouse()
  22. local Character = Player.Character or Player.CharacterAdded:Wait()
  23. local Humanoid = Character:FindFirstChildOfClass("Humanoid")
  24.  
  25. -- Настройка GUI
  26. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  27.  
  28. Frame.Parent = ScreenGui
  29. Frame.Size = UDim2.new(0, 250, 0, 285) -- Размер окна
  30. Frame.Position = UDim2.new(0.5, -100, 0.5, -50) -- Размещение в центре
  31. Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  32. Frame.BackgroundTransparency = 0.15
  33. Frame.BorderSizePixel = 0
  34. Frame.Visible = false
  35.  
  36. UICorner.Parent = Frame
  37. UICorner.CornerRadius = UDim.new(0, 15)
  38.  
  39. local GUIHeader = Instance.new("TextLabel")
  40. GUIHeader.Parent = Frame
  41. GUIHeader.Size = UDim2.new(1, 0, 0, 30)
  42. GUIHeader.Position = UDim2.new(0, 0, 0, 0)
  43. GUIHeader.Text = "GUI by Zumhad"
  44. GUIHeader.TextColor3 = Color3.fromRGB(255, 255, 255)
  45. GUIHeader.Font = Enum.Font.SourceSansBold
  46. GUIHeader.TextSize = 20
  47. GUIHeader.BackgroundTransparency = 1
  48.  
  49. -- Функция анимации появления
  50. local function fadeIn()
  51.     Frame.Visible = true
  52.     local tween = TweenService:Create(Frame, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {BackgroundTransparency = 0.15})
  53.     tween:Play()
  54. end
  55.  
  56. -- Функция анимации сворачивания
  57. local function fadeOut()
  58.     local tween = TweenService:Create(Frame, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {BackgroundTransparency = 1})
  59.     tween:Play()
  60.     tween.Completed:Connect(function()
  61.         Frame.Visible = false
  62.     end)
  63. end
  64.  
  65. fadeIn()
  66.  
  67. local ToggleButton = Instance.new("TextButton")
  68. ToggleButton.Parent = ScreenGui
  69. ToggleButton.Size = UDim2.new(0, 75, 0, 75) -- Увеличенный размер (50x50)
  70. ToggleButton.Position = UDim2.new(0, 10, 0.5, -250) -- Размещаем слева по центру
  71. ToggleButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20) -- Чёрный цвет
  72. ToggleButton.BorderSizePixel = 0
  73. ToggleButton.Text = "MENU"
  74. ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  75. ToggleButton.Font = Enum.Font.SourceSansBold
  76. ToggleButton.TextSize = 20
  77.  
  78. -- Убираем округление, чтобы был квадрат
  79. local ToggleUICorner = Instance.new("UICorner")
  80. ToggleUICorner.Parent = ToggleButton
  81. ToggleUICorner.CornerRadius = UDim.new(0, 5)
  82.  
  83. -- Функция переключения видимости
  84. local function toggleMenu()
  85.     if Frame.Visible then
  86.         fadeOut()
  87.     else
  88.         fadeIn()
  89.     end
  90. end
  91.  
  92. -- Подключаем клик на кнопку
  93. ToggleButton.MouseButton1Click:Connect(toggleMenu)
  94.  
  95. -- Кнопка Close
  96. CloseButton.Parent = Frame
  97. CloseButton.Size = UDim2.new(1, 0, 0, 40)
  98. CloseButton.Position = UDim2.new(0, 0, 1, -40)
  99. CloseButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  100. CloseButton.BackgroundTransparency = 0.15
  101. CloseButton.BorderSizePixel = 0
  102. CloseButton.Text = "CLOSE"
  103. CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  104. CloseButton.Font = Enum.Font.SourceSansBold
  105. CloseButton.TextSize = 20
  106. CloseButton.MouseButton1Click:Connect(function()
  107.     ScreenGui:Destroy()
  108.         isFollowing = false
  109.    
  110.     local character = game.Players.LocalPlayer.Character
  111.     if character and character:FindFirstChild("Humanoid") then
  112.         character.Humanoid:Move(Vector3.new(0, 0, 0)) -- Останавливаем движение
  113.     end
  114. end)
  115.  
  116. -- Кнопка свернуть
  117. MinimizeButton.Parent = Frame
  118. MinimizeButton.Size = UDim2.new(0, 30, 0, 30)
  119. MinimizeButton.Position = UDim2.new(1, -35, 0, 5)
  120. MinimizeButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  121. MinimizeButton.BackgroundTransparency = 0.15
  122. MinimizeButton.BorderSizePixel = 0
  123. MinimizeButton.Text = "-"
  124. MinimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  125. MinimizeButton.Font = Enum.Font.SourceSansBold
  126. MinimizeButton.TextSize = 35
  127. MinimizeButton.MouseButton1Click:Connect(function()
  128.     fadeOut()
  129.     isMinimized = true
  130. end)
  131.  
  132. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  133.     if not gameProcessed and input.KeyCode == Enum.KeyCode.LeftControl then
  134.         if Frame.Visible then
  135.             fadeOut()
  136.         else
  137.             fadeIn()
  138.         end
  139.     end
  140. end)
  141.  
  142. -- Кнопка AutoCoin
  143. local AutoCoinButton = Instance.new("TextButton")
  144. AutoCoinButton.Parent = Frame
  145. AutoCoinButton.Size = UDim2.new(1, 0, 0, 40)
  146. AutoCoinButton.Position = UDim2.new(0, 0, 1, -190)
  147. AutoCoinButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  148. AutoCoinButton.BackgroundTransparency = 0.15
  149. AutoCoinButton.BorderSizePixel = 0
  150. AutoCoinButton.Text = "AUTOCOIN"
  151. AutoCoinButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  152. AutoCoinButton.Font = Enum.Font.SourceSansBold
  153. AutoCoinButton.TextSize = 20
  154.  
  155. local AutoCoinSettings = Instance.new("Frame")
  156. AutoCoinSettings.Parent = Frame
  157. AutoCoinSettings.Size = UDim2.new(1, 0, 0, 140) -- Занимает всю ширину основного меню
  158. AutoCoinSettings.Position = UDim2.new(0, 0, 0, -150) -- Размещается сверху
  159. AutoCoinSettings.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  160. AutoCoinSettings.BackgroundTransparency = 0.15
  161. AutoCoinSettings.Visible = false
  162.  
  163. local UICornerAutoCoin = Instance.new("UICorner")
  164. UICornerAutoCoin.Parent = AutoCoinSettings
  165. UICornerAutoCoin.CornerRadius = UDim.new(0, 10)
  166.  
  167. AutoCoinButton.MouseButton1Click:Connect(function()
  168.     isAutoCoinSettingsOpen = not isAutoCoinSettingsOpen
  169.     AutoCoinSettings.Visible = isAutoCoinSettingsOpen
  170. end)
  171.  
  172. local AutoCoinLabel = Instance.new("TextLabel")
  173. AutoCoinLabel.Parent = AutoCoinSettings
  174. AutoCoinLabel.Size = UDim2.new(1, 0, 0, 30)
  175. AutoCoinLabel.Position = UDim2.new(0, 0, 0, 5)
  176. AutoCoinLabel.Text = "Auto Collect Coin"
  177. AutoCoinLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  178. AutoCoinLabel.Font = Enum.Font.SourceSansBold
  179. AutoCoinLabel.TextSize = 20
  180. AutoCoinLabel.BackgroundTransparency = 1
  181.  
  182. local CollectStatus = Instance.new("TextLabel")
  183. CollectStatus.Parent = AutoCoinSettings
  184. CollectStatus.Size = UDim2.new(1, 0, 0, 70)
  185. CollectStatus.Position = UDim2.new(0, 0, 0, 5)
  186. CollectStatus.Text = isFollowing and "STATUS ON" or "STATUS OFF"
  187. CollectStatus.TextColor3 = isFollowing and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  188. CollectStatus.Font = Enum.Font.SourceSansBold
  189. CollectStatus.TextSize = 20
  190. CollectStatus.BackgroundTransparency = 1
  191.  
  192. local function updateCollectStatus()
  193.     CollectStatus.Text = isCollecting and "STATUS ON" or "STATUS OFF"
  194.     CollectStatus.TextColor3 = isCollecting and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  195. end
  196.  
  197. local function getClosestCoin()
  198.     local closestCoin = nil
  199.     local minDistance = math.huge
  200.     local playerPosition = Character.PrimaryPart.Position
  201.  
  202.     for _, obj in pairs(workspace:GetDescendants()) do
  203.         if obj.Name == "Coin" and obj:IsA("BasePart") then
  204.             local distance = (playerPosition - obj.Position).Magnitude
  205.             if distance < minDistance then
  206.                 minDistance = distance
  207.                 closestCoin = obj
  208.             end
  209.         end
  210.     end
  211.  
  212.     return closestCoin
  213. end
  214.  
  215.  
  216.  
  217. local function moveToCoin()
  218.     if not isCollecting then return end -- Если авто-сбор выключен, не двигаемся
  219.  
  220.     local humanoid = Character:FindFirstChildOfClass("Humanoid")
  221.     if not humanoid then return end
  222.  
  223.     currentTarget = getClosestCoin()
  224.  
  225.     if currentTarget then
  226.         print("🚀 Двигаемся к монете:", currentTarget.Name)
  227.         isMovingToCoin = true
  228.  
  229.         while isCollecting and currentTarget do
  230.             -- Обновляем путь каждые 0.1 секунды, чтобы избежать прерывания движения
  231.             humanoid:MoveTo(currentTarget.Position)
  232.            
  233.             -- Если монета исчезла, выходим из цикла
  234.             if not currentTarget or not currentTarget.Parent then
  235.                 print("❌ Монета исчезла!")
  236.                 break
  237.             end
  238.  
  239.             task.wait(0.1)
  240.         end
  241.  
  242.         isMovingToCoin = false -- Разблокируем движение
  243.     else
  244.         print("❌ Монет нет!")
  245.     end
  246. end
  247.  
  248. -- Кнопка ON
  249. local CollectOnButton = Instance.new("TextButton")
  250. CollectOnButton.Parent = AutoCoinSettings
  251. CollectOnButton.Size = UDim2.new(0, 80, 0, 30)
  252. CollectOnButton.Position = UDim2.new(0.5, -90, 0, 60)
  253. CollectOnButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  254. CollectOnButton.Text = "ON"
  255. CollectOnButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  256. CollectOnButton.Font = Enum.Font.SourceSansBold
  257. CollectOnButton.TextSize = 18
  258.  
  259. CollectOnButton.MouseButton1Click:Connect(function()
  260.     isCollecting = true
  261.     updateCollectStatus()
  262.     print("🔵 Авто-сбор монет ВКЛЮЧЕН")
  263.  
  264.     while isCollecting do
  265.         moveToCoin()
  266.         task.wait(0.5) -- Ждем немного перед повторным поиском монеты
  267.     end
  268. end)
  269.  
  270.  
  271. -- Кнопка OFF
  272. local CollectOffButton = Instance.new("TextButton")
  273. CollectOffButton.Parent = AutoCoinSettings
  274. CollectOffButton.Size = UDim2.new(0, 80, 0, 30)
  275. CollectOffButton.Position = UDim2.new(0.5, 10, 0, 60)
  276. CollectOffButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  277. CollectOffButton.Text = "OFF"
  278. CollectOffButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  279. CollectOffButton.Font = Enum.Font.SourceSansBold
  280. CollectOffButton.TextSize = 18
  281.  
  282. CollectOffButton.MouseButton1Click:Connect(function()
  283.     isCollecting = false
  284.     isMovingToCoin = false
  285.     updateCollectStatus()
  286.     print("🔴 Авто-сбор монет ВЫКЛЮЧЕН")
  287. end)
  288.  
  289. updateCollectStatus()
  290.  
  291. -- Кнопка MoveSpeed
  292. local MoveSpeedButton = Instance.new("TextButton")
  293. MoveSpeedButton.Parent = Frame
  294. MoveSpeedButton.Size = UDim2.new(1, 0, 0, 40)
  295. MoveSpeedButton.Position = UDim2.new(0, 0, 1, -140)
  296. MoveSpeedButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  297. MoveSpeedButton.BackgroundTransparency = 0.15
  298. MoveSpeedButton.BorderSizePixel = 0
  299. MoveSpeedButton.Text = "MOVESPEED"
  300. MoveSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  301. MoveSpeedButton.Font = Enum.Font.SourceSansBold
  302. MoveSpeedButton.TextSize = 20
  303.  
  304. local MoveSpeedSettings = Instance.new("Frame")
  305. MoveSpeedSettings.Parent = Frame
  306. MoveSpeedSettings.Size = UDim2.new(0, 200, 0, 140)
  307. MoveSpeedSettings.Position = UDim2.new(0, MoveSpeedButton.Position.X.Offset - 210, 1, -140)
  308. MoveSpeedSettings.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  309. MoveSpeedSettings.BackgroundTransparency = 0.15
  310. MoveSpeedSettings.Visible = false
  311.  
  312. local MoveSpeedButtonLabel = Instance.new("TextLabel")
  313. MoveSpeedButtonLabel.Parent = MoveSpeedSettings
  314. MoveSpeedButtonLabel.Size = UDim2.new(1, 0, 0, 30)
  315. MoveSpeedButtonLabel.Position = UDim2.new(0, 0, 0, 5)
  316. MoveSpeedButtonLabel.Text = "MoveSpeed Settings"
  317. MoveSpeedButtonLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  318. MoveSpeedButtonLabel.Font = Enum.Font.SourceSansBold
  319. MoveSpeedButtonLabel.TextSize = 20
  320. MoveSpeedButtonLabel.BackgroundTransparency = 1
  321.  
  322. local CurrentSpeedLabel = Instance.new("TextLabel")
  323. CurrentSpeedLabel.Parent = MoveSpeedSettings
  324. CurrentSpeedLabel.Size = UDim2.new(1, 0, 0, 30)
  325. CurrentSpeedLabel.Position = UDim2.new(0, 0, 0, 40)
  326. CurrentSpeedLabel.Text = "Current Speed: " .. tostring(game.Players.LocalPlayer.Character.Humanoid.WalkSpeed)
  327. CurrentSpeedLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  328. CurrentSpeedLabel.Font = Enum.Font.SourceSansBold
  329. CurrentSpeedLabel.TextSize = 18
  330. CurrentSpeedLabel.BackgroundTransparency = 1
  331.  
  332. local IncreaseSpeedButton = Instance.new("TextButton")
  333. IncreaseSpeedButton.Parent = MoveSpeedSettings
  334. IncreaseSpeedButton.Size = UDim2.new(0, 80, 0, 30)
  335. IncreaseSpeedButton.Position = UDim2.new(0.5, -90, 0, 80)
  336. IncreaseSpeedButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  337. IncreaseSpeedButton.Text = "+1"
  338. IncreaseSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  339. IncreaseSpeedButton.Font = Enum.Font.SourceSansBold
  340. IncreaseSpeedButton.TextSize = 18
  341.  
  342. local DecreaseSpeedButton = Instance.new("TextButton")
  343. DecreaseSpeedButton.Parent = MoveSpeedSettings
  344. DecreaseSpeedButton.Size = UDim2.new(0, 80, 0, 30)
  345. DecreaseSpeedButton.Position = UDim2.new(0.5, 10, 0, 80)
  346. DecreaseSpeedButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  347. DecreaseSpeedButton.Text = "-1"
  348. DecreaseSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  349. DecreaseSpeedButton.Font = Enum.Font.SourceSansBold
  350. DecreaseSpeedButton.TextSize = 18
  351.  
  352. IncreaseSpeedButton.MouseButton1Click:Connect(function()
  353.     local humanoid = game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
  354.     if humanoid then
  355.         humanoid.WalkSpeed = humanoid.WalkSpeed + 1
  356.         CurrentSpeedLabel.Text = "Current Speed: " .. tostring(humanoid.WalkSpeed)
  357.     end
  358. end)
  359.  
  360. DecreaseSpeedButton.MouseButton1Click:Connect(function()
  361.     local humanoid = game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
  362.     if humanoid then
  363.         humanoid.WalkSpeed = humanoid.WalkSpeed - 1
  364.         CurrentSpeedLabel.Text = "Current Speed: " .. tostring(humanoid.WalkSpeed)
  365.     end
  366. end)
  367.  
  368. MoveSpeedButton.MouseButton1Click:Connect(function()
  369.     MoveSpeedSettings.Visible = not MoveSpeedSettings.Visible
  370.     CurrentSpeedLabel.Text = "Current Speed: " .. tostring(game.Players.LocalPlayer.Character.Humanoid.WalkSpeed)
  371. end)
  372.  
  373. -- Кнопка FOLLOW
  374. local FollowButton = Instance.new("TextButton")
  375. FollowButton.Parent = Frame
  376. FollowButton.Size = UDim2.new(1, 0, 0, 40)
  377. FollowButton.Position = UDim2.new(0, 0, 1, -90)
  378. FollowButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  379. FollowButton.BackgroundTransparency = 0.15
  380. FollowButton.BorderSizePixel = 0
  381. FollowButton.Text = "FOLLOW"
  382. FollowButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  383. FollowButton.Font = Enum.Font.SourceSansBold
  384. FollowButton.TextSize = 20
  385.  
  386. -- Окно настроек FOLLOW (расположено справа от FOLLOW)
  387. local FollowSettings = Instance.new("Frame")
  388. FollowSettings.Parent = Frame
  389. FollowSettings.Size = UDim2.new(0, 200, 0, 140)
  390. FollowSettings.Position = UDim2.new(0, FollowButton.Position.X.Offset + 260, 1, -140)
  391. FollowSettings.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  392. FollowSettings.BackgroundTransparency = 0.15
  393. FollowSettings.Visible = false
  394.  
  395. local StatusLabel = Instance.new("TextLabel")
  396. StatusLabel.Parent = FollowSettings
  397. StatusLabel.Size = UDim2.new(1, 0, 0, 30)
  398. StatusLabel.Position = UDim2.new(0, 0, 0, 5)
  399. StatusLabel.Text = isFollowing and "STATUS ON" or "STATUS OFF"
  400. StatusLabel.TextColor3 = isFollowing and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  401. StatusLabel.Font = Enum.Font.SourceSansBold
  402. StatusLabel.TextSize = 20
  403. StatusLabel.BackgroundTransparency = 1
  404.  
  405. FollowButton.MouseButton1Click:Connect(function()
  406.     isFollowMenuOpen = not isFollowMenuOpen
  407.     FollowSettings.Visible = isFollowMenuOpen
  408. end)
  409.  
  410. -- Поле для ввода никнейма
  411. local UsernameInput = Instance.new("TextBox")
  412. UsernameInput.Parent = FollowSettings
  413. UsernameInput.Size = UDim2.new(0, 180, 0, 30)
  414. UsernameInput.Position = UDim2.new(0.5, -90, 0, 80)
  415. UsernameInput.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  416. UsernameInput.TextColor3 = Color3.fromRGB(255, 255, 255)
  417. UsernameInput.Font = Enum.Font.SourceSansBold
  418. UsernameInput.TextSize = 18
  419. UsernameInput.PlaceholderText = "Enter username"
  420. UsernameInput.Text = ""
  421.  
  422. -- Поле для вывода статуса
  423. local StatusMessage = Instance.new("TextLabel")
  424. StatusMessage.Parent = FollowSettings
  425. StatusMessage.Size = UDim2.new(1, 0, 0, 30)
  426. StatusMessage.Position = UDim2.new(0, 0, 0, 115)
  427. StatusMessage.Text = ""
  428. StatusMessage.TextColor3 = Color3.fromRGB(255, 255, 255)
  429. StatusMessage.Font = Enum.Font.SourceSansBold
  430. StatusMessage.TextSize = 18
  431. StatusMessage.BackgroundTransparency = 1
  432.  
  433.  
  434. local function moveToPlayer(targetPlayer)
  435.     -- Если персонаж в данный момент движется к монете, не двигаемся к игроку
  436.     if isMovingToCoin then return end
  437.  
  438.     local character = game.Players.LocalPlayer.Character
  439.     if not character or not character:FindFirstChild("HumanoidRootPart") then return end
  440.  
  441.     local hrp = character.HumanoidRootPart
  442.     local targetChar = targetPlayer.Character
  443.     if not targetChar or not targetChar:FindFirstChild("HumanoidRootPart") then return end
  444.  
  445.     local targetHrp = targetChar.HumanoidRootPart
  446.  
  447.     -- Разворачиваемся в сторону игрока
  448.     hrp.CFrame = CFrame.new(hrp.Position, targetHrp.Position)
  449.  
  450.     -- Двигаемся к цели
  451.     local humanoid = character:FindFirstChild("Humanoid")
  452.     if humanoid then
  453.         humanoid:MoveTo(targetHrp.Position)
  454.         humanoid.MoveToFinished:Wait() -- Ждем завершения движения
  455.     end
  456. end
  457.  
  458. -- Кнопка ON
  459. local FollowOnButton = Instance.new("TextButton")
  460. FollowOnButton.Parent = FollowSettings
  461. FollowOnButton.Size = UDim2.new(0, 80, 0, 30)
  462. FollowOnButton.Position = UDim2.new(0.5, -90, 0, 35)
  463. FollowOnButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  464. FollowOnButton.Text = "ON"
  465. FollowOnButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  466. FollowOnButton.Font = Enum.Font.SourceSansBold
  467. FollowOnButton.TextSize = 18
  468.  
  469. -- Кнопка OFF
  470. local FollowOffButton = Instance.new("TextButton")
  471. FollowOffButton.Parent = FollowSettings
  472. FollowOffButton.Size = UDim2.new(0, 80, 0, 30)
  473. FollowOffButton.Position = UDim2.new(0.5, 10, 0, 35)
  474. FollowOffButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  475. FollowOffButton.Text = "OFF"
  476. FollowOffButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  477. FollowOffButton.Font = Enum.Font.SourceSansBold
  478. FollowOffButton.TextSize = 18
  479.  
  480. FollowOnButton.MouseButton1Click:Connect(function()
  481.     local username = UsernameInput.Text
  482.     local targetPlayer = nil
  483.    
  484.     for _, player in pairs(game.Players:GetPlayers()) do
  485.         if player.Name == username then
  486.             targetPlayer = player
  487.             break
  488.         end
  489.     end
  490.    
  491.     if targetPlayer then
  492.         isFollowing = true
  493.         StatusLabel.Text = "STATUS ON"
  494.         StatusLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
  495.        
  496.         StatusMessage.Text = "Player is online!"
  497.         StatusMessage.TextColor3 = Color3.fromRGB(0, 255, 0)
  498.  
  499.         while isFollowing do
  500.             moveToPlayer(targetPlayer)
  501.             task.wait(0.1)
  502.         end
  503.     else
  504.         StatusLabel.Text = "STATUS OFF"
  505.         StatusLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  506.         StatusMessage.Text = "Player is not on the server!"
  507.         StatusMessage.TextColor3 = Color3.fromRGB(255, 0, 0)
  508.     end
  509. end)
  510.  
  511. FollowOffButton.MouseButton1Click:Connect(function()
  512.     StatusLabel.Text = "STATUS OFF"
  513.     StatusLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  514.     isFollowing = false
  515.    
  516.     local character = game.Players.LocalPlayer.Character
  517.     if character and character:FindFirstChild("Humanoid") then
  518.         character.Humanoid:Move(Vector3.new(0, 0, 0)) -- Останавливаем движение
  519.     end
  520. end)
  521.  
  522.  
  523. -- Переменные для движения основного меню
  524. local frameDragging, frameDragInput, frameDragStart, frameStartPos
  525.  
  526. Frame.InputBegan:Connect(function(input)
  527.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  528.         frameDragging = true
  529.         frameDragStart = input.Position
  530.         frameStartPos = Frame.Position
  531.         input.Changed:Connect(function()
  532.             if input.UserInputState == Enum.UserInputState.End then
  533.                 frameDragging = false
  534.             end
  535.         end)
  536.     end
  537. end)
  538.  
  539. Frame.InputChanged:Connect(function(input)
  540.     if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  541.         frameDragInput = input
  542.     end
  543. end)
  544.  
  545. UserInputService.InputChanged:Connect(function(input)
  546.     if input == frameDragInput and frameDragging then
  547.         local delta = input.Position - frameDragStart
  548.         Frame.Position = UDim2.new(frameStartPos.X.Scale, frameStartPos.X.Offset + delta.X, frameStartPos.Y.Scale, frameStartPos.Y.Offset + delta.Y)
  549.     end
  550. end)
  551.  
  552. -- Переменные для движения ToggleButton
  553. local buttonDragging, buttonDragInput, buttonDragStart, buttonStartPos
  554.  
  555. ToggleButton.InputBegan:Connect(function(input)
  556.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  557.         buttonDragging = true
  558.         buttonDragStart = input.Position
  559.         buttonStartPos = ToggleButton.Position
  560.         input.Changed:Connect(function()
  561.             if input.UserInputState == Enum.UserInputState.End then
  562.                 buttonDragging = false
  563.             end
  564.         end)
  565.     end
  566. end)
  567.  
  568. ToggleButton.InputChanged:Connect(function(input)
  569.     if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  570.         buttonDragInput = input
  571.     end
  572. end)
  573.  
  574. UserInputService.InputChanged:Connect(function(input)
  575.     if input == buttonDragInput and buttonDragging then
  576.         local delta = input.Position - buttonDragStart
  577.         ToggleButton.Position = UDim2.new(buttonStartPos.X.Scale, buttonStartPos.X.Offset + delta.X, buttonStartPos.Y.Scale, buttonStartPos.Y.Offset + delta.Y)
  578.     end
  579. end)
Advertisement
Add Comment
Please, Sign In to add comment