Advertisement
Nythic

Baseplate Drifting script

Jul 17th, 2025 (edited)
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.22 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local LocalPlayer = Players.LocalPlayer
  4.  
  5. local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
  6. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  7. local RootPart = Character:WaitForChild("HumanoidRootPart")
  8. local UserInputService = game:GetService("UserInputService")
  9.  
  10. --- GLOBALNE ZMIENNE DLA AUTO-KRĘCENIA ---
  11. local AUTO_FARM_ACTIVE = false
  12. local AUTO_FARM_SPEED = 3.5 -- Domyślna prędkość, zgodna z suwakiem GUI
  13. local AUTO_FARM_RADIUS = 30
  14. local AUTO_FARM_HEIGHT = 50
  15. local AUTO_FARM_PLATFORM_SIZE = Vector3.new(200, 2, 200)
  16.  
  17. local autoFarmConnection
  18. local autoFarmAngle = 0
  19. local autoFarmPlatformCenter
  20. local autoFarmPlatformPart
  21.  
  22. --- GLOBALNE ZMIENNE DLA GUI ---
  23. local GUI_TRANSPARENCY = 0.0 -- Domyślna przezroczystość (całkowicie widoczne)
  24. local GUI_VISIBILITY_KEYBIND = Enum.KeyCode.K -- Domyślny klawisz do ukrywania/pokazywania GUI
  25.  
  26. --- FUNKCJE AUTO-KRĘCENIA ---
  27.  
  28. -- Znajdź siedzenie pojazdu, w którym znajduje się gracz
  29. local function getVehicleSeat()
  30.     for _, v in pairs(workspace:GetDescendants()) do
  31.         if v:IsA("VehicleSeat") and v.Occupant == Character:FindFirstChildOfClass("Humanoid") then
  32.             return v
  33.         end
  34.     end
  35.     return nil
  36. end
  37.  
  38. -- Tworzy platformę
  39. local function createPlatform(centerPos)
  40.     if autoFarmPlatformPart then
  41.         autoFarmPlatformPart:Destroy()
  42.     end
  43.  
  44.     local part = Instance.new("Part")
  45.     part.Size = AUTO_FARM_PLATFORM_SIZE
  46.     part.Anchored = true
  47.     part.Position = centerPos
  48.     part.Color = Color3.fromRGB(80, 80, 80)
  49.     part.Material = Enum.Material.Concrete
  50.     part.Name = "AutoPlatforma"
  51.     part.Parent = workspace
  52.     autoFarmPlatformPart = part
  53. end
  54.  
  55. -- Usuwa platformę
  56. local function removePlatform()
  57.     if autoFarmPlatformPart then
  58.         autoFarmPlatformPart:Destroy()
  59.         autoFarmPlatformPart = nil
  60.     end
  61. end
  62.  
  63. -- Teleportuje samochód i gracza na platformę
  64. local function teleportWithCar(car, platformCenter)
  65.     local carModel = car.Parent
  66.     local carOffset = Vector3.new(0, 3, 0)
  67.     local charOffset = Vector3.new(0, 6, 0)
  68.     local carPos = platformCenter + carOffset
  69.     local charPos = platformCenter + charOffset
  70.  
  71.     if carModel.PrimaryPart then
  72.         carModel:SetPrimaryPartCFrame(CFrame.new(carPos))
  73.     else
  74.         carModel:PivotTo(CFrame.new(carPos))
  75.     end
  76.  
  77.     if Character.PrimaryPart then
  78.         Character:SetPrimaryPartCFrame(CFrame.new(charPos))
  79.     else
  80.         Character:PivotTo(CFrame.new(charPos))
  81.     end
  82. end
  83.  
  84. -- Aktywacja/dezaktywacja auto-kręcenia
  85. local function toggleAutoFarm(activeState)
  86.     AUTO_FARM_ACTIVE = activeState
  87.  
  88.     if AUTO_FARM_ACTIVE then
  89.         local car = getVehicleSeat()
  90.         if not car then
  91.             warn("Nie jesteś w pojeździe! Aby użyć autofarmu, musisz być w samochodzie.")
  92.             -- Opcjonalnie: zresetuj przełącznik w GUI, aby wskazywał na 'off'
  93.             return false -- Zwraca false, jeśli nie udało się aktywować
  94.         end
  95.  
  96.         autoFarmPlatformCenter = Vector3.new(RootPart.Position.X, RootPart.Position.Y + AUTO_FARM_HEIGHT, RootPart.Position.Z)
  97.         createPlatform(autoFarmPlatformCenter)
  98.         teleportWithCar(car, autoFarmPlatformCenter)
  99.  
  100.         autoFarmAngle = 0
  101.         autoFarmConnection = RunService.Heartbeat:Connect(function(dt)
  102.             if not car or not car.Parent or not car.Parent.PrimaryPart then
  103.                 toggleAutoFarm(false) -- Wyłącz, jeśli samochód zniknął
  104.                 return
  105.             end
  106.             autoFarmAngle += dt * AUTO_FARM_SPEED
  107.             local x = math.cos(autoFarmAngle) * AUTO_FARM_RADIUS
  108.             local z = math.sin(autoFarmAngle) * AUTO_FARM_RADIUS
  109.             local targetPos = autoFarmPlatformCenter + Vector3.new(x, 3, z)
  110.  
  111.             local carModel = car.Parent
  112.             local carPos = carModel.PrimaryPart.Position
  113.             local dir = (targetPos - carPos).Unit
  114.             carModel.PrimaryPart.AssemblyLinearVelocity = dir * 90 -- Stała prędkość do przodu
  115.         end)
  116.     else
  117.         if autoFarmConnection then autoFarmConnection:Disconnect() end
  118.         local car = getVehicleSeat()
  119.         if car and car.Parent and car.Parent.PrimaryPart then
  120.             car.Parent.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0) -- Zatrzymuje samochód
  121.         end
  122.         removePlatform()
  123.     end
  124.     return true -- Zwraca true, jeśli akcja powiodła się
  125. end
  126.  
  127. --- FUNKCJE GAMEPASS SPOOFINGU ---
  128. local function activateGamepassSpoof()
  129.     local spoofedPasses = {
  130.         [1174800921] = true,
  131.         [1221140012] = true
  132.     }
  133.  
  134.     -- Hijack the metatable to spoof ownership checks
  135.     local mt = getrawmetatable(game)
  136.     setreadonly(mt, false)
  137.     local old = mt.__namecall
  138.  
  139.     mt.__namecall = newcclosure(function(self, ...)
  140.         local args = {...}
  141.         local method = getnamecallmethod()
  142.  
  143.         if method == "UserOwnsGamePassAsync" and typeof(args[2]) == "number" then
  144.             if spoofedPasses[args[2]] then
  145.                 return true
  146.             end
  147.         end
  148.  
  149.         return old(self, unpack(args))
  150.     end)
  151.  
  152.     -- Optional: Log spoof success
  153.     for id, _ in pairs(spoofedPasses) do
  154.         print("Gamepass spoofed:", id)
  155.     end
  156.     warn("Gamepass spoofing activated!")
  157. end
  158.  
  159.  
  160. --- TWORZENIE GUI ---
  161. local screenGui = Instance.new("ScreenGui")
  162. screenGui.Name = "AutoFarmModernUI"
  163. screenGui.Parent = PlayerGui
  164.  
  165. local mainFrame = Instance.new("Frame")
  166. mainFrame.Size = UDim2.new(0, 400, 0, 300)
  167. mainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
  168. mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  169. mainFrame.BorderSizePixel = 0
  170. mainFrame.Parent = screenGui
  171. mainFrame.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw początkową przezroczystość
  172.  
  173. local corner = Instance.new("UICorner")
  174. corner.CornerRadius = UDim.new(0, 10)
  175. corner.Parent = mainFrame
  176.  
  177. -- Lewy panel na zakładki
  178. local sidebar = Instance.new("Frame")
  179. sidebar.Size = UDim2.new(0, 100, 1, 0)
  180. sidebar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  181. sidebar.Parent = mainFrame
  182. sidebar.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  183.  
  184. local sidebarCorner = Instance.new("UICorner")
  185. sidebarCorner.CornerRadius = UDim.new(0, 10)
  186. sidebarCorner.Parent = sidebar
  187.  
  188. -- Funkcja tworząca przycisk w sidebarze
  189. local function createSidebarButton(text, positionY)
  190.     local btn = Instance.new("TextButton")
  191.     btn.Size = UDim2.new(1, 0, 0, 40)
  192.     btn.Position = UDim2.new(0, 0, 0, positionY)
  193.     btn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  194.     btn.BorderSizePixel = 0
  195.     btn.Text = text
  196.     btn.Font = Enum.Font.Gotham
  197.     btn.TextSize = 16
  198.     btn.TextColor3 = Color3.fromRGB(200, 200, 200)
  199.     btn.Parent = sidebar
  200.     btn.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  201.  
  202.     local corner = Instance.new("UICorner")
  203.     corner.CornerRadius = UDim.new(0, 8)
  204.     corner.Parent = btn
  205.  
  206.     btn.MouseEnter:Connect(function()
  207.         btn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  208.     end)
  209.     btn.MouseLeave:Connect(function()
  210.         btn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  211.     end)
  212.  
  213.     return btn
  214. end
  215.  
  216. local mainContent = Instance.new("Frame")
  217. mainContent.Size = UDim2.new(1, -100, 1, 0)
  218. mainContent.Position = UDim2.new(0, 100, 0, 0)
  219. mainContent.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  220. mainContent.Parent = mainFrame
  221. mainContent.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  222.  
  223. local mainCorner = Instance.new("UICorner")
  224. mainCorner.CornerRadius = UDim.new(0, 10)
  225. mainCorner.Parent = mainContent
  226.  
  227. -- Przełącznik (toggle) - Autofarm
  228. local function createToggle(name, posY, parent, initialValue, callback)
  229.     local label = Instance.new("TextLabel")
  230.     label.Size = UDim2.new(0, 200, 0, 30)
  231.     label.Position = UDim2.new(0, 10, 0, posY)
  232.     label.BackgroundTransparency = 1 -- Zawsze przezroczyste tło dla tekstu
  233.     label.Text = name
  234.     label.Font = Enum.Font.Gotham
  235.     label.TextSize = 18
  236.     label.TextColor3 = Color3.fromRGB(230, 230, 230)
  237.     label.TextXAlignment = Enum.TextXAlignment.Left
  238.     label.Parent = parent
  239.  
  240.     local toggle = Instance.new("Frame")
  241.     toggle.Size = UDim2.new(0, 50, 0, 25)
  242.     toggle.Position = UDim2.new(1, -60, 0, posY + 2)
  243.     toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  244.     toggle.Parent = parent
  245.     toggle.AnchorPoint = Vector2.new(1, 0)
  246.     toggle.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  247.  
  248.     local toggleCorner = Instance.new("UICorner")
  249.     toggleCorner.CornerRadius = UDim.new(0, 15)
  250.     toggleCorner.Parent = toggle
  251.  
  252.     local circle = Instance.new("Frame")
  253.     circle.Size = UDim2.new(0, 20, 0, 20)
  254.     circle.Position = UDim2.new(0, 2, 0, 2)
  255.     circle.BackgroundColor3 = Color3.fromRGB(180, 180, 180)
  256.     circle.Parent = toggle
  257.     circle.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  258.  
  259.     local circleCorner = Instance.new("UICorner")
  260.     circleCorner.CornerRadius = UDim.new(1, 0)
  261.     circleCorner.Parent = circle
  262.  
  263.     local toggled = initialValue
  264.  
  265.     local function updateToggleVisual()
  266.         if toggled then
  267.             toggle.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  268.             circle:TweenPosition(UDim2.new(1, -22, 0, 2), "Out", "Sine", 0.2, true)
  269.         else
  270.             toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  271.             circle:TweenPosition(UDim2.new(0, 2, 0, 2), "Out", "Sine", 0.2, true)
  272.         end
  273.     end
  274.  
  275.     toggle.InputBegan:Connect(function(input)
  276.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  277.             toggled = not toggled
  278.             if callback then
  279.                 local success = callback(toggled)
  280.                 if not success then -- Jeśli callback zwróci false (np. brak samochodu), cofnij toggle
  281.                     toggled = not toggled
  282.                 end
  283.             end
  284.             updateToggleVisual()
  285.         end
  286.     end)
  287.  
  288.     updateToggleVisual() -- Ustaw początkowy stan wizualny
  289.     return toggled, toggle
  290. end
  291.  
  292. -- Slider (przykład) - poziom prędkości
  293. local function createSlider(name, posY, parent, min, max, default, callback)
  294.     local label = Instance.new("TextLabel")
  295.     label.Size = UDim2.new(0, 200, 0, 20)
  296.     label.Position = UDim2.new(0, 10, 0, posY)
  297.     label.BackgroundTransparency = 1 -- Zawsze przezroczyste tło dla tekstu
  298.     label.Text = name .. ": " .. tostring(default)
  299.     label.Font = Enum.Font.Gotham
  300.     label.TextSize = 16
  301.     label.TextColor3 = Color3.fromRGB(230, 230, 230)
  302.     label.TextXAlignment = Enum.TextXAlignment.Left
  303.     label.Parent = parent
  304.  
  305.     local sliderFrame = Instance.new("Frame")
  306.     sliderFrame.Size = UDim2.new(0, 250, 0, 10)
  307.     sliderFrame.Position = UDim2.new(0, 10, 0, posY + 25)
  308.     sliderFrame.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  309.     sliderFrame.Parent = parent
  310.     sliderFrame.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  311.  
  312.     local sliderCorner = Instance.new("UICorner")
  313.     sliderCorner.CornerRadius = UDim.new(0, 5)
  314.     sliderCorner.Parent = sliderFrame
  315.  
  316.     local fill = Instance.new("Frame")
  317.     fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
  318.     fill.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  319.     fill.Parent = sliderFrame
  320.     fill.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
  321.  
  322.     local fillCorner = Instance.new("UICorner")
  323.     fillCorner.CornerRadius = UDim.new(0, 5)
  324.     fillCorner.Parent = fill
  325.  
  326.     local dragging = false
  327.     local currentValue = default
  328.  
  329.     local function updateSlider(input)
  330.         local relativeX = math.clamp(input.Position.X - sliderFrame.AbsolutePosition.X, 0, sliderFrame.AbsoluteSize.X)
  331.         local percent = relativeX / sliderFrame.AbsoluteSize.X
  332.         fill.Size = UDim2.new(percent, 0, 1, 0)
  333.         currentValue = min + percent * (max - min) -- Zmieniamy na float dla przezroczystości
  334.         label.Text = name .. ": " .. string.format("%.1f", currentValue) -- Formatujemy do 1 miejsca po przecinku
  335.         if callback then
  336.             callback(currentValue)
  337.         end
  338.     end
  339.  
  340.     sliderFrame.InputBegan:Connect(function(input)
  341.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  342.             dragging = true
  343.             updateSlider(input) -- Aktualizacja przy pierwszym kliknięciu
  344.         end
  345.     end)
  346.  
  347.     sliderFrame.InputEnded:Connect(function(input)
  348.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  349.             dragging = false
  350.         end
  351.     end)
  352.  
  353.     sliderFrame.InputChanged:Connect(function(input)
  354.         if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  355.             updateSlider(input)
  356.         end
  357.     end)
  358.  
  359.     -- Ustaw początkowy stan wypełnienia
  360.     fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
  361.     return label -- Zwracamy label, żeby móc aktualizować tekst, jeśli będzie potrzebne
  362. end
  363.  
  364. -- Dodajemy przyciski w sidebarze
  365. local btnFarming = createSidebarButton("Farming", 10)
  366. local btnAutoRace = createSidebarButton("Auto Race", 60) -- Nowy przycisk dla Auto Race
  367. local btnFreeGamepass = createSidebarButton("FREE GAMEPASS", 110) -- Przesunięto
  368. local btnSettings = createSidebarButton("Settings", 160) -- Przesunięto
  369. local btnCredits = createSidebarButton("Credits", 210) -- Przesunięto
  370.  
  371.  
  372. -- Strona dla Farming
  373. local farmingFrame = Instance.new("Frame")
  374. farmingFrame.Size = UDim2.new(1, 0, 1, 0)
  375. farmingFrame.BackgroundTransparency = 1
  376. farmingFrame.Parent = mainContent
  377.  
  378. -- Nagłówek sekcji Farming
  379. local farmingTitle = Instance.new("TextLabel")
  380. farmingTitle.Size = UDim2.new(1, -20, 0, 40)
  381. farmingTitle.Position = UDim2.new(0, 10, 0, 10)
  382. farmingTitle.BackgroundTransparency = GUI_TRANSPARENCY
  383. farmingTitle.Text = "Farming"
  384. farmingTitle.Font = Enum.Font.GothamBold
  385. farmingTitle.TextSize = 24
  386. farmingTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  387. farmingTitle.TextXAlignment = Enum.TextXAlignment.Left
  388. farmingTitle.Parent = farmingFrame -- Przenieś nagłówek na stronę Farming
  389.  
  390. local autofarmToggleInstance, autofarmToggleButton = createToggle("Autofarm", 60, farmingFrame, AUTO_FARM_ACTIVE, function(toggled)
  391.     local success = toggleAutoFarm(toggled)
  392.     if not success then
  393.         -- Jeśli nie udało się włączyć (np. brak samochodu), zresetuj toggle wizualnie
  394.         autofarmToggleInstance = false -- Zaktualizuj stan wewnętrzny
  395.         return false
  396.     end
  397.     return true
  398. end)
  399.  
  400. createSlider("Speed", 110, farmingFrame, 1, 10, AUTO_FARM_SPEED, function(value)
  401.     AUTO_FARM_SPEED = value
  402.     -- Możesz tu dodać logikę, aby natychmiast zastosować zmianę prędkości do bieżącego kręcenia
  403.     -- W tym przypadku, funkcja Heartbeat w toggleAutoFarm(true) będzie używać nowej wartości AUTO_FARM_SPEED
  404. end)
  405.  
  406. -- Nowa strona dla Auto Race (Coming Soon)
  407. local autoRaceFrame = Instance.new("Frame")
  408. autoRaceFrame.Size = UDim2.new(1, 0, 1, 0)
  409. autoRaceFrame.BackgroundTransparency = 1
  410. autoRaceFrame.Parent = mainContent
  411. autoRaceFrame.Visible = false -- Domyślnie niewidoczna
  412.  
  413. local autoRaceTitle = Instance.new("TextLabel")
  414. autoRaceTitle.Size = UDim2.new(1, -20, 0, 40)
  415. autoRaceTitle.Position = UDim2.new(0, 10, 0, 10)
  416. autoRaceTitle.BackgroundTransparency = 1
  417. autoRaceTitle.Text = "Auto Race"
  418. autoRaceTitle.Font = Enum.Font.GothamBold
  419. autoRaceTitle.TextSize = 24
  420. autoRaceTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  421. autoRaceTitle.TextXAlignment = Enum.TextXAlignment.Left
  422. autoRaceTitle.Parent = autoRaceFrame
  423.  
  424. local comingSoonLabel = Instance.new("TextLabel")
  425. comingSoonLabel.Size = UDim2.new(1, -20, 0, 100)
  426. comingSoonLabel.Position = UDim2.new(0, 10, 0.5, -50) -- Centrowanie
  427. comingSoonLabel.BackgroundTransparency = 1
  428. comingSoonLabel.Text = "COMING SOON!"
  429. comingSoonLabel.Font = Enum.Font.GothamBold
  430. comingSoonLabel.TextSize = 36
  431. comingSoonLabel.TextColor3 = Color3.fromRGB(255, 100, 100) -- Czerwony kolor
  432. comingSoonLabel.TextWrapped = true
  433. comingSoonLabel.TextXAlignment = Enum.TextXAlignment.Center
  434. comingSoonLabel.TextYAlignment = Enum.TextYAlignment.Center
  435. comingSoonLabel.Parent = autoRaceFrame
  436.  
  437.  
  438. -- Nowa strona dla Free Gamepass
  439. local freeGamepassFrame = Instance.new("Frame")
  440. freeGamepassFrame.Size = UDim2.new(1, 0, 1, 0)
  441. freeGamepassFrame.BackgroundTransparency = 1
  442. freeGamepassFrame.Parent = mainContent
  443. freeGamepassFrame.Visible = false
  444.  
  445. local freeGamepassTitle = Instance.new("TextLabel")
  446. freeGamepassTitle.Size = UDim2.new(1, -20, 0, 40)
  447. freeGamepassTitle.Position = UDim2.new(0, 10, 0, 10)
  448. freeGamepassTitle.BackgroundTransparency = 1
  449. freeGamepassTitle.Text = "FREE GAMEPASS"
  450. freeGamepassTitle.Font = Enum.Font.GothamBold
  451. freeGamepassTitle.TextSize = 24
  452. freeGamepassTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  453. freeGamepassTitle.TextXAlignment = Enum.TextXAlignment.Left
  454. freeGamepassTitle.Parent = freeGamepassFrame
  455.  
  456. local activateGamepassButton = Instance.new("TextButton")
  457. activateGamepassButton.Size = UDim2.new(0, 250, 0, 50) -- Zwiększony rozmiar
  458. activateGamepassButton.Position = UDim2.new(0.5, -125, 0.5, -25) -- Wyśrodkowany
  459. activateGamepassButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  460. activateGamepassButton.BorderSizePixel = 0
  461. activateGamepassButton.Text = "Unlock Gamepass" -- Zmieniony tekst
  462. activateGamepassButton.Font = Enum.Font.GothamBold
  463. activateGamepassButton.TextSize = 20 -- Zwiększona wielkość tekstu
  464. activateGamepassButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  465. activateGamepassButton.Parent = freeGamepassFrame
  466.  
  467. local activateButtonCorner = Instance.new("UICorner")
  468. activateButtonCorner.CornerRadius = UDim.new(0, 10)
  469. activateButtonCorner.Parent = activateGamepassButton
  470.  
  471. activateGamepassButton.MouseButton1Click:Connect(function()
  472.     activateGamepassSpoof()
  473.     activateGamepassButton.Text = "Gamepass Activated!" -- Zmieniony tekst po aktywacji
  474.     activateGamepassButton.BackgroundColor3 = Color3.fromRGB(0, 200, 0) -- Zmień kolor na zielony po aktywacji
  475.     activateGamepassButton.Active = false -- Wyłącz przycisk po aktywacji
  476.     activateGamepassButton.TextColor3 = Color3.fromRGB(255,255,255)
  477. end)
  478.  
  479.  
  480. -- Dodaj ramki dla innych sekcji (domyślnie niewidoczne)
  481. local settingsFrame = Instance.new("Frame")
  482. settingsFrame.Size = UDim2.new(1, 0, 1, 0)
  483. settingsFrame.BackgroundTransparency = 1
  484. settingsFrame.Parent = mainContent
  485. settingsFrame.Visible = false
  486.  
  487. local creditsFrame = Instance.new("Frame")
  488. creditsFrame.Size = UDim2.new(1, 0, 1, 0)
  489. creditsFrame.BackgroundTransparency = 1
  490. creditsFrame.Parent = mainContent
  491. creditsFrame.Visible = false
  492.  
  493. -- Funkcja do przełączania widocznych zakładek
  494. local function setActivePage(pageToShow)
  495.     for _, child in pairs(mainContent:GetChildren()) do
  496.         if child:IsA("Frame") then -- Sprawdzamy wszystkie ramki
  497.             child.Visible = false
  498.         end
  499.     end
  500.     -- Ukryj wszystkie tytuły, a potem pokaż tylko właściwy
  501.     farmingTitle.Visible = false
  502.     freeGamepassTitle.Visible = false
  503.     autoRaceTitle.Visible = false -- Dodano nowy tytuł
  504.  
  505.     if pageToShow then
  506.         pageToShow.Visible = true
  507.         -- Upewnij się, że odpowiedni tytuł jest widoczny dla aktywnej strony
  508.         if pageToShow == farmingFrame then
  509.             farmingTitle.Visible = true
  510.         elseif pageToShow == freeGamepassFrame then
  511.             freeGamepassTitle.Visible = true
  512.         elseif pageToShow == autoRaceFrame then -- Nowa logika dla Auto Race
  513.             autoRaceTitle.Visible = true
  514.         end
  515.     end
  516. end
  517.  
  518. -- Ustaw początkową widoczność na Farming
  519. setActivePage(farmingFrame)
  520.  
  521. -- Przełączanie zakładek
  522. btnFarming.MouseButton1Click:Connect(function()
  523.     setActivePage(farmingFrame)
  524. end)
  525.  
  526. btnAutoRace.MouseButton1Click:Connect(function() -- Obsługa przycisku Auto Race
  527.     setActivePage(autoRaceFrame)
  528. end)
  529.  
  530. btnFreeGamepass.MouseButton1Click:Connect(function()
  531.     setActivePage(freeGamepassFrame)
  532. end)
  533.  
  534. btnSettings.MouseButton1Click:Connect(function()
  535.     setActivePage(settingsFrame)
  536.     local settingsLabel = Instance.new("TextLabel")
  537.     settingsLabel.Size = UDim2.new(1, -20, 0, 40)
  538.     settingsLabel.Position = UDim2.new(0, 10, 0, 10)
  539.     settingsLabel.BackgroundTransparency = 1
  540.     settingsLabel.Text = "Settings"
  541.     settingsLabel.Font = Enum.Font.GothamBold
  542.     settingsLabel.TextSize = 24
  543.     settingsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  544.     settingsLabel.TextXAlignment = Enum.TextXAlignment.Left
  545.     settingsLabel.Parent = settingsFrame
  546.  
  547.     -- Slider przezroczystości GUI
  548.     createSlider("GUI Transparency", 60, settingsFrame, 0, 1, GUI_TRANSPARENCY, function(value)
  549.         GUI_TRANSPARENCY = value
  550.         -- Rekurencyjnie ustaw przezroczystość dla wszystkich elementów GUI
  551.         local function setTransparency(instance, transparency)
  552.             if instance:IsA("GuiObject") then
  553.                 instance.BackgroundTransparency = transparency
  554.                 instance.TextTransparency = transparency
  555.                 instance.ImageTransparency = transparency
  556.             end
  557.             for _, child in pairs(instance:GetChildren()) do
  558.                 setTransparency(child, transparency)
  559.             end
  560.         end
  561.         setTransparency(mainFrame, GUI_TRANSPARENCY)
  562.     end)
  563.  
  564.     -- Keybind do ukrywania/pokazywania GUI
  565.     local keybindLabel = Instance.new("TextLabel")
  566.     keybindLabel.Size = UDim2.new(0, 200, 0, 20)
  567.     keybindLabel.Position = UDim2.new(0, 10, 0, 130)
  568.     keybindLabel.BackgroundTransparency = 1
  569.     keybindLabel.Text = "Hide/Show Keybind: " .. GUI_VISIBILITY_KEYBIND.Name
  570.     keybindLabel.Font = Enum.Font.Gotham
  571.     keybindLabel.TextSize = 16
  572.     keybindLabel.TextColor3 = Color3.fromRGB(230, 230, 230)
  573.     keybindLabel.TextXAlignment = Enum.TextXAlignment.Left
  574.     keybindLabel.Parent = settingsFrame
  575.  
  576.     local changeKeybindButton = Instance.new("TextButton")
  577.     changeKeybindButton.Size = UDim2.new(0, 100, 0, 30)
  578.     changeKeybindButton.Position = UDim2.new(0, 10, 0, 155)
  579.     changeKeybindButton.BackgroundColor3 = Color3.fromRGB(0, 120, 200)
  580.     changeKeybindButton.BorderSizePixel = 0
  581.     changeKeybindButton.Text = "Change Keybind"
  582.     changeKeybindButton.Font = Enum.Font.Gotham
  583.     changeKeybindButton.TextSize = 14
  584.     changeKeybindButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  585.     changeKeybindButton.Parent = settingsFrame
  586.  
  587.     local listeningForInput = false
  588.  
  589.     changeKeybindButton.MouseButton1Click:Connect(function()
  590.         if not listeningForInput then
  591.             listeningForInput = true
  592.             keybindLabel.Text = "Press any key..."
  593.             keybindLabel.TextColor3 = Color3.fromRGB(255, 255, 0) -- Żółty kolor, żeby było widać, że czeka na input
  594.  
  595.             local inputConnection
  596.             inputConnection = UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
  597.                 if not gameProcessedEvent and input.UserInputType == Enum.UserInputType.Keyboard then
  598.                     GUI_VISIBILITY_KEYBIND = input.KeyCode
  599.                     keybindLabel.Text = "Hide/Show Keybind: " .. GUI_VISIBILITY_KEYBIND.Name
  600.                     keybindLabel.TextColor3 = Color3.fromRGB(230, 230, 230) -- Przywróć domyślny kolor
  601.                     listeningForInput = false
  602.                     inputConnection:Disconnect() -- Odłączamy połączenie po otrzymaniu inputu
  603.                 end
  604.             end)
  605.         end
  606.     end)
  607. end)
  608.  
  609. btnCredits.MouseButton1Click:Connect(function()
  610.     setActivePage(creditsFrame)
  611.     local creditsLabel = Instance.new("TextLabel")
  612.     creditsLabel.Size = UDim2.new(1, -20, 0, 40)
  613.     creditsLabel.Position = UDim2.new(0, 10, 0, 10)
  614.     creditsLabel.BackgroundTransparency = 1
  615.     creditsLabel.Text = "Credits"
  616.     creditsLabel.Font = Enum.Font.GothamBold
  617.     creditsLabel.TextSize = 24
  618.     creditsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  619.     creditsLabel.TextXAlignment = Enum.TextXAlignment.Left
  620.     creditsLabel.Parent = creditsFrame
  621.  
  622.     local creditsText = Instance.new("TextLabel")
  623.     creditsText.Size = UDim2.new(1, -20, 0, 100)
  624.     creditsText.Position = UDim2.new(0, 10, 0, 60)
  625.     creditsText.BackgroundTransparency = 1
  626.     creditsText.Text = "GUI Design by [NYTHIC]\nAuto-farm Logic by [ME]\nSpecial Thanks to Roblox Using my script!"
  627.     creditsText.Font = Enum.Font.Gotham
  628.     creditsText.TextSize = 14
  629.     creditsText.TextColor3 = Color3.fromRGB(200, 200, 200)
  630.     creditsText.TextWrapped = true
  631.     creditsText.TextXAlignment = Enum.TextXAlignment.Left
  632.     creditsText.TextYAlignment = Enum.TextYAlignment.Top
  633.     creditsText.Parent = creditsFrame
  634. end)
  635.  
  636.  
  637. --- LOGIKA PRZECIĄGANIA GUI ---
  638. local dragging = false
  639. local dragStart = Vector2.new(0,0)
  640. local initialPosition = UDim2.new(0,0,0,0)
  641.  
  642. mainFrame.InputBegan:Connect(function(input)
  643.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  644.         dragging = true
  645.         dragStart = input.Position
  646.         initialPosition = mainFrame.Position
  647.  
  648.         UserInputService.MouseIconEnabled = false
  649.         UserInputService.MouseIcon = "rbxassetid://60505166" -- Ikona ręki lub inna pasująca
  650.     end
  651. end)
  652.  
  653. mainFrame.InputChanged:Connect(function(input)
  654.     if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and dragging then
  655.         local delta = input.Position - dragStart
  656.         local newX = initialPosition.X.Offset + delta.X
  657.         local newY = initialPosition.Y.Offset + delta.Y
  658.         mainFrame.Position = UDim2.new(0, newX, 0, newY)
  659.     end
  660. end)
  661.  
  662. mainFrame.InputEnded:Connect(function(input)
  663.     if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and dragging then
  664.         dragging = false
  665.         UserInputService.MouseIconEnabled = true
  666.         UserInputService.MouseIcon = "" -- Domyślna ikona myszy
  667.     end
  668. end)
  669.  
  670. --- OBSŁUGA KLAWISZY (KEYBINDS) ---
  671. UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
  672.     if input.KeyCode == GUI_VISIBILITY_KEYBIND and not gameProcessedEvent then
  673.         screenGui.Enabled = not screenGui.Enabled
  674.     end
  675. end)
Tags: Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement