Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local LocalPlayer = Players.LocalPlayer
- local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
- local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
- local RootPart = Character:WaitForChild("HumanoidRootPart")
- local UserInputService = game:GetService("UserInputService")
- --- GLOBALNE ZMIENNE DLA AUTO-KRĘCENIA ---
- local AUTO_FARM_ACTIVE = false
- local AUTO_FARM_SPEED = 3.5 -- Domyślna prędkość, zgodna z suwakiem GUI
- local AUTO_FARM_RADIUS = 30
- local AUTO_FARM_HEIGHT = 50
- local AUTO_FARM_PLATFORM_SIZE = Vector3.new(200, 2, 200)
- local autoFarmConnection
- local autoFarmAngle = 0
- local autoFarmPlatformCenter
- local autoFarmPlatformPart
- --- GLOBALNE ZMIENNE DLA GUI ---
- local GUI_TRANSPARENCY = 0.0 -- Domyślna przezroczystość (całkowicie widoczne)
- local GUI_VISIBILITY_KEYBIND = Enum.KeyCode.K -- Domyślny klawisz do ukrywania/pokazywania GUI
- --- FUNKCJE AUTO-KRĘCENIA ---
- -- Znajdź siedzenie pojazdu, w którym znajduje się gracz
- local function getVehicleSeat()
- for _, v in pairs(workspace:GetDescendants()) do
- if v:IsA("VehicleSeat") and v.Occupant == Character:FindFirstChildOfClass("Humanoid") then
- return v
- end
- end
- return nil
- end
- -- Tworzy platformę
- local function createPlatform(centerPos)
- if autoFarmPlatformPart then
- autoFarmPlatformPart:Destroy()
- end
- local part = Instance.new("Part")
- part.Size = AUTO_FARM_PLATFORM_SIZE
- part.Anchored = true
- part.Position = centerPos
- part.Color = Color3.fromRGB(80, 80, 80)
- part.Material = Enum.Material.Concrete
- part.Name = "AutoPlatforma"
- part.Parent = workspace
- autoFarmPlatformPart = part
- end
- -- Usuwa platformę
- local function removePlatform()
- if autoFarmPlatformPart then
- autoFarmPlatformPart:Destroy()
- autoFarmPlatformPart = nil
- end
- end
- -- Teleportuje samochód i gracza na platformę
- local function teleportWithCar(car, platformCenter)
- local carModel = car.Parent
- local carOffset = Vector3.new(0, 3, 0)
- local charOffset = Vector3.new(0, 6, 0)
- local carPos = platformCenter + carOffset
- local charPos = platformCenter + charOffset
- if carModel.PrimaryPart then
- carModel:SetPrimaryPartCFrame(CFrame.new(carPos))
- else
- carModel:PivotTo(CFrame.new(carPos))
- end
- if Character.PrimaryPart then
- Character:SetPrimaryPartCFrame(CFrame.new(charPos))
- else
- Character:PivotTo(CFrame.new(charPos))
- end
- end
- -- Aktywacja/dezaktywacja auto-kręcenia
- local function toggleAutoFarm(activeState)
- AUTO_FARM_ACTIVE = activeState
- if AUTO_FARM_ACTIVE then
- local car = getVehicleSeat()
- if not car then
- warn("Nie jesteś w pojeździe! Aby użyć autofarmu, musisz być w samochodzie.")
- -- Opcjonalnie: zresetuj przełącznik w GUI, aby wskazywał na 'off'
- return false -- Zwraca false, jeśli nie udało się aktywować
- end
- autoFarmPlatformCenter = Vector3.new(RootPart.Position.X, RootPart.Position.Y + AUTO_FARM_HEIGHT, RootPart.Position.Z)
- createPlatform(autoFarmPlatformCenter)
- teleportWithCar(car, autoFarmPlatformCenter)
- autoFarmAngle = 0
- autoFarmConnection = RunService.Heartbeat:Connect(function(dt)
- if not car or not car.Parent or not car.Parent.PrimaryPart then
- toggleAutoFarm(false) -- Wyłącz, jeśli samochód zniknął
- return
- end
- autoFarmAngle += dt * AUTO_FARM_SPEED
- local x = math.cos(autoFarmAngle) * AUTO_FARM_RADIUS
- local z = math.sin(autoFarmAngle) * AUTO_FARM_RADIUS
- local targetPos = autoFarmPlatformCenter + Vector3.new(x, 3, z)
- local carModel = car.Parent
- local carPos = carModel.PrimaryPart.Position
- local dir = (targetPos - carPos).Unit
- carModel.PrimaryPart.AssemblyLinearVelocity = dir * 90 -- Stała prędkość do przodu
- end)
- else
- if autoFarmConnection then autoFarmConnection:Disconnect() end
- local car = getVehicleSeat()
- if car and car.Parent and car.Parent.PrimaryPart then
- car.Parent.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0) -- Zatrzymuje samochód
- end
- removePlatform()
- end
- return true -- Zwraca true, jeśli akcja powiodła się
- end
- --- FUNKCJE GAMEPASS SPOOFINGU ---
- local function activateGamepassSpoof()
- local spoofedPasses = {
- [1174800921] = true,
- [1221140012] = true
- }
- -- Hijack the metatable to spoof ownership checks
- local mt = getrawmetatable(game)
- setreadonly(mt, false)
- local old = mt.__namecall
- mt.__namecall = newcclosure(function(self, ...)
- local args = {...}
- local method = getnamecallmethod()
- if method == "UserOwnsGamePassAsync" and typeof(args[2]) == "number" then
- if spoofedPasses[args[2]] then
- return true
- end
- end
- return old(self, unpack(args))
- end)
- -- Optional: Log spoof success
- for id, _ in pairs(spoofedPasses) do
- print("Gamepass spoofed:", id)
- end
- warn("Gamepass spoofing activated!")
- end
- --- TWORZENIE GUI ---
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "AutoFarmModernUI"
- screenGui.Parent = PlayerGui
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 400, 0, 300)
- mainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
- mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- mainFrame.BorderSizePixel = 0
- mainFrame.Parent = screenGui
- mainFrame.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw początkową przezroczystość
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 10)
- corner.Parent = mainFrame
- -- Lewy panel na zakładki
- local sidebar = Instance.new("Frame")
- sidebar.Size = UDim2.new(0, 100, 1, 0)
- sidebar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
- sidebar.Parent = mainFrame
- sidebar.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local sidebarCorner = Instance.new("UICorner")
- sidebarCorner.CornerRadius = UDim.new(0, 10)
- sidebarCorner.Parent = sidebar
- -- Funkcja tworząca przycisk w sidebarze
- local function createSidebarButton(text, positionY)
- local btn = Instance.new("TextButton")
- btn.Size = UDim2.new(1, 0, 0, 40)
- btn.Position = UDim2.new(0, 0, 0, positionY)
- btn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- btn.BorderSizePixel = 0
- btn.Text = text
- btn.Font = Enum.Font.Gotham
- btn.TextSize = 16
- btn.TextColor3 = Color3.fromRGB(200, 200, 200)
- btn.Parent = sidebar
- btn.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 8)
- corner.Parent = btn
- btn.MouseEnter:Connect(function()
- btn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- end)
- btn.MouseLeave:Connect(function()
- btn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- end)
- return btn
- end
- local mainContent = Instance.new("Frame")
- mainContent.Size = UDim2.new(1, -100, 1, 0)
- mainContent.Position = UDim2.new(0, 100, 0, 0)
- mainContent.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- mainContent.Parent = mainFrame
- mainContent.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local mainCorner = Instance.new("UICorner")
- mainCorner.CornerRadius = UDim.new(0, 10)
- mainCorner.Parent = mainContent
- -- Przełącznik (toggle) - Autofarm
- local function createToggle(name, posY, parent, initialValue, callback)
- local label = Instance.new("TextLabel")
- label.Size = UDim2.new(0, 200, 0, 30)
- label.Position = UDim2.new(0, 10, 0, posY)
- label.BackgroundTransparency = 1 -- Zawsze przezroczyste tło dla tekstu
- label.Text = name
- label.Font = Enum.Font.Gotham
- label.TextSize = 18
- label.TextColor3 = Color3.fromRGB(230, 230, 230)
- label.TextXAlignment = Enum.TextXAlignment.Left
- label.Parent = parent
- local toggle = Instance.new("Frame")
- toggle.Size = UDim2.new(0, 50, 0, 25)
- toggle.Position = UDim2.new(1, -60, 0, posY + 2)
- toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- toggle.Parent = parent
- toggle.AnchorPoint = Vector2.new(1, 0)
- toggle.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local toggleCorner = Instance.new("UICorner")
- toggleCorner.CornerRadius = UDim.new(0, 15)
- toggleCorner.Parent = toggle
- local circle = Instance.new("Frame")
- circle.Size = UDim2.new(0, 20, 0, 20)
- circle.Position = UDim2.new(0, 2, 0, 2)
- circle.BackgroundColor3 = Color3.fromRGB(180, 180, 180)
- circle.Parent = toggle
- circle.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local circleCorner = Instance.new("UICorner")
- circleCorner.CornerRadius = UDim.new(1, 0)
- circleCorner.Parent = circle
- local toggled = initialValue
- local function updateToggleVisual()
- if toggled then
- toggle.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- circle:TweenPosition(UDim2.new(1, -22, 0, 2), "Out", "Sine", 0.2, true)
- else
- toggle.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- circle:TweenPosition(UDim2.new(0, 2, 0, 2), "Out", "Sine", 0.2, true)
- end
- end
- toggle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- toggled = not toggled
- if callback then
- local success = callback(toggled)
- if not success then -- Jeśli callback zwróci false (np. brak samochodu), cofnij toggle
- toggled = not toggled
- end
- end
- updateToggleVisual()
- end
- end)
- updateToggleVisual() -- Ustaw początkowy stan wizualny
- return toggled, toggle
- end
- -- Slider (przykład) - poziom prędkości
- local function createSlider(name, posY, parent, min, max, default, callback)
- local label = Instance.new("TextLabel")
- label.Size = UDim2.new(0, 200, 0, 20)
- label.Position = UDim2.new(0, 10, 0, posY)
- label.BackgroundTransparency = 1 -- Zawsze przezroczyste tło dla tekstu
- label.Text = name .. ": " .. tostring(default)
- label.Font = Enum.Font.Gotham
- label.TextSize = 16
- label.TextColor3 = Color3.fromRGB(230, 230, 230)
- label.TextXAlignment = Enum.TextXAlignment.Left
- label.Parent = parent
- local sliderFrame = Instance.new("Frame")
- sliderFrame.Size = UDim2.new(0, 250, 0, 10)
- sliderFrame.Position = UDim2.new(0, 10, 0, posY + 25)
- sliderFrame.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- sliderFrame.Parent = parent
- sliderFrame.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local sliderCorner = Instance.new("UICorner")
- sliderCorner.CornerRadius = UDim.new(0, 5)
- sliderCorner.Parent = sliderFrame
- local fill = Instance.new("Frame")
- fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
- fill.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- fill.Parent = sliderFrame
- fill.BackgroundTransparency = GUI_TRANSPARENCY -- Ustaw przezroczystość
- local fillCorner = Instance.new("UICorner")
- fillCorner.CornerRadius = UDim.new(0, 5)
- fillCorner.Parent = fill
- local dragging = false
- local currentValue = default
- local function updateSlider(input)
- local relativeX = math.clamp(input.Position.X - sliderFrame.AbsolutePosition.X, 0, sliderFrame.AbsoluteSize.X)
- local percent = relativeX / sliderFrame.AbsoluteSize.X
- fill.Size = UDim2.new(percent, 0, 1, 0)
- currentValue = min + percent * (max - min) -- Zmieniamy na float dla przezroczystości
- label.Text = name .. ": " .. string.format("%.1f", currentValue) -- Formatujemy do 1 miejsca po przecinku
- if callback then
- callback(currentValue)
- end
- end
- sliderFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- updateSlider(input) -- Aktualizacja przy pierwszym kliknięciu
- end
- end)
- sliderFrame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- sliderFrame.InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- updateSlider(input)
- end
- end)
- -- Ustaw początkowy stan wypełnienia
- fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
- return label -- Zwracamy label, żeby móc aktualizować tekst, jeśli będzie potrzebne
- end
- -- Dodajemy przyciski w sidebarze
- local btnFarming = createSidebarButton("Farming", 10)
- local btnAutoRace = createSidebarButton("Auto Race", 60) -- Nowy przycisk dla Auto Race
- local btnFreeGamepass = createSidebarButton("FREE GAMEPASS", 110) -- Przesunięto
- local btnSettings = createSidebarButton("Settings", 160) -- Przesunięto
- local btnCredits = createSidebarButton("Credits", 210) -- Przesunięto
- -- Strona dla Farming
- local farmingFrame = Instance.new("Frame")
- farmingFrame.Size = UDim2.new(1, 0, 1, 0)
- farmingFrame.BackgroundTransparency = 1
- farmingFrame.Parent = mainContent
- -- Nagłówek sekcji Farming
- local farmingTitle = Instance.new("TextLabel")
- farmingTitle.Size = UDim2.new(1, -20, 0, 40)
- farmingTitle.Position = UDim2.new(0, 10, 0, 10)
- farmingTitle.BackgroundTransparency = GUI_TRANSPARENCY
- farmingTitle.Text = "Farming"
- farmingTitle.Font = Enum.Font.GothamBold
- farmingTitle.TextSize = 24
- farmingTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
- farmingTitle.TextXAlignment = Enum.TextXAlignment.Left
- farmingTitle.Parent = farmingFrame -- Przenieś nagłówek na stronę Farming
- local autofarmToggleInstance, autofarmToggleButton = createToggle("Autofarm", 60, farmingFrame, AUTO_FARM_ACTIVE, function(toggled)
- local success = toggleAutoFarm(toggled)
- if not success then
- -- Jeśli nie udało się włączyć (np. brak samochodu), zresetuj toggle wizualnie
- autofarmToggleInstance = false -- Zaktualizuj stan wewnętrzny
- return false
- end
- return true
- end)
- createSlider("Speed", 110, farmingFrame, 1, 10, AUTO_FARM_SPEED, function(value)
- AUTO_FARM_SPEED = value
- -- Możesz tu dodać logikę, aby natychmiast zastosować zmianę prędkości do bieżącego kręcenia
- -- W tym przypadku, funkcja Heartbeat w toggleAutoFarm(true) będzie używać nowej wartości AUTO_FARM_SPEED
- end)
- -- Nowa strona dla Auto Race (Coming Soon)
- local autoRaceFrame = Instance.new("Frame")
- autoRaceFrame.Size = UDim2.new(1, 0, 1, 0)
- autoRaceFrame.BackgroundTransparency = 1
- autoRaceFrame.Parent = mainContent
- autoRaceFrame.Visible = false -- Domyślnie niewidoczna
- local autoRaceTitle = Instance.new("TextLabel")
- autoRaceTitle.Size = UDim2.new(1, -20, 0, 40)
- autoRaceTitle.Position = UDim2.new(0, 10, 0, 10)
- autoRaceTitle.BackgroundTransparency = 1
- autoRaceTitle.Text = "Auto Race"
- autoRaceTitle.Font = Enum.Font.GothamBold
- autoRaceTitle.TextSize = 24
- autoRaceTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
- autoRaceTitle.TextXAlignment = Enum.TextXAlignment.Left
- autoRaceTitle.Parent = autoRaceFrame
- local comingSoonLabel = Instance.new("TextLabel")
- comingSoonLabel.Size = UDim2.new(1, -20, 0, 100)
- comingSoonLabel.Position = UDim2.new(0, 10, 0.5, -50) -- Centrowanie
- comingSoonLabel.BackgroundTransparency = 1
- comingSoonLabel.Text = "COMING SOON!"
- comingSoonLabel.Font = Enum.Font.GothamBold
- comingSoonLabel.TextSize = 36
- comingSoonLabel.TextColor3 = Color3.fromRGB(255, 100, 100) -- Czerwony kolor
- comingSoonLabel.TextWrapped = true
- comingSoonLabel.TextXAlignment = Enum.TextXAlignment.Center
- comingSoonLabel.TextYAlignment = Enum.TextYAlignment.Center
- comingSoonLabel.Parent = autoRaceFrame
- -- Nowa strona dla Free Gamepass
- local freeGamepassFrame = Instance.new("Frame")
- freeGamepassFrame.Size = UDim2.new(1, 0, 1, 0)
- freeGamepassFrame.BackgroundTransparency = 1
- freeGamepassFrame.Parent = mainContent
- freeGamepassFrame.Visible = false
- local freeGamepassTitle = Instance.new("TextLabel")
- freeGamepassTitle.Size = UDim2.new(1, -20, 0, 40)
- freeGamepassTitle.Position = UDim2.new(0, 10, 0, 10)
- freeGamepassTitle.BackgroundTransparency = 1
- freeGamepassTitle.Text = "FREE GAMEPASS"
- freeGamepassTitle.Font = Enum.Font.GothamBold
- freeGamepassTitle.TextSize = 24
- freeGamepassTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
- freeGamepassTitle.TextXAlignment = Enum.TextXAlignment.Left
- freeGamepassTitle.Parent = freeGamepassFrame
- local activateGamepassButton = Instance.new("TextButton")
- activateGamepassButton.Size = UDim2.new(0, 250, 0, 50) -- Zwiększony rozmiar
- activateGamepassButton.Position = UDim2.new(0.5, -125, 0.5, -25) -- Wyśrodkowany
- activateGamepassButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- activateGamepassButton.BorderSizePixel = 0
- activateGamepassButton.Text = "Unlock Gamepass" -- Zmieniony tekst
- activateGamepassButton.Font = Enum.Font.GothamBold
- activateGamepassButton.TextSize = 20 -- Zwiększona wielkość tekstu
- activateGamepassButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- activateGamepassButton.Parent = freeGamepassFrame
- local activateButtonCorner = Instance.new("UICorner")
- activateButtonCorner.CornerRadius = UDim.new(0, 10)
- activateButtonCorner.Parent = activateGamepassButton
- activateGamepassButton.MouseButton1Click:Connect(function()
- activateGamepassSpoof()
- activateGamepassButton.Text = "Gamepass Activated!" -- Zmieniony tekst po aktywacji
- activateGamepassButton.BackgroundColor3 = Color3.fromRGB(0, 200, 0) -- Zmień kolor na zielony po aktywacji
- activateGamepassButton.Active = false -- Wyłącz przycisk po aktywacji
- activateGamepassButton.TextColor3 = Color3.fromRGB(255,255,255)
- end)
- -- Dodaj ramki dla innych sekcji (domyślnie niewidoczne)
- local settingsFrame = Instance.new("Frame")
- settingsFrame.Size = UDim2.new(1, 0, 1, 0)
- settingsFrame.BackgroundTransparency = 1
- settingsFrame.Parent = mainContent
- settingsFrame.Visible = false
- local creditsFrame = Instance.new("Frame")
- creditsFrame.Size = UDim2.new(1, 0, 1, 0)
- creditsFrame.BackgroundTransparency = 1
- creditsFrame.Parent = mainContent
- creditsFrame.Visible = false
- -- Funkcja do przełączania widocznych zakładek
- local function setActivePage(pageToShow)
- for _, child in pairs(mainContent:GetChildren()) do
- if child:IsA("Frame") then -- Sprawdzamy wszystkie ramki
- child.Visible = false
- end
- end
- -- Ukryj wszystkie tytuły, a potem pokaż tylko właściwy
- farmingTitle.Visible = false
- freeGamepassTitle.Visible = false
- autoRaceTitle.Visible = false -- Dodano nowy tytuł
- if pageToShow then
- pageToShow.Visible = true
- -- Upewnij się, że odpowiedni tytuł jest widoczny dla aktywnej strony
- if pageToShow == farmingFrame then
- farmingTitle.Visible = true
- elseif pageToShow == freeGamepassFrame then
- freeGamepassTitle.Visible = true
- elseif pageToShow == autoRaceFrame then -- Nowa logika dla Auto Race
- autoRaceTitle.Visible = true
- end
- end
- end
- -- Ustaw początkową widoczność na Farming
- setActivePage(farmingFrame)
- -- Przełączanie zakładek
- btnFarming.MouseButton1Click:Connect(function()
- setActivePage(farmingFrame)
- end)
- btnAutoRace.MouseButton1Click:Connect(function() -- Obsługa przycisku Auto Race
- setActivePage(autoRaceFrame)
- end)
- btnFreeGamepass.MouseButton1Click:Connect(function()
- setActivePage(freeGamepassFrame)
- end)
- btnSettings.MouseButton1Click:Connect(function()
- setActivePage(settingsFrame)
- local settingsLabel = Instance.new("TextLabel")
- settingsLabel.Size = UDim2.new(1, -20, 0, 40)
- settingsLabel.Position = UDim2.new(0, 10, 0, 10)
- settingsLabel.BackgroundTransparency = 1
- settingsLabel.Text = "Settings"
- settingsLabel.Font = Enum.Font.GothamBold
- settingsLabel.TextSize = 24
- settingsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- settingsLabel.TextXAlignment = Enum.TextXAlignment.Left
- settingsLabel.Parent = settingsFrame
- -- Slider przezroczystości GUI
- createSlider("GUI Transparency", 60, settingsFrame, 0, 1, GUI_TRANSPARENCY, function(value)
- GUI_TRANSPARENCY = value
- -- Rekurencyjnie ustaw przezroczystość dla wszystkich elementów GUI
- local function setTransparency(instance, transparency)
- if instance:IsA("GuiObject") then
- instance.BackgroundTransparency = transparency
- instance.TextTransparency = transparency
- instance.ImageTransparency = transparency
- end
- for _, child in pairs(instance:GetChildren()) do
- setTransparency(child, transparency)
- end
- end
- setTransparency(mainFrame, GUI_TRANSPARENCY)
- end)
- -- Keybind do ukrywania/pokazywania GUI
- local keybindLabel = Instance.new("TextLabel")
- keybindLabel.Size = UDim2.new(0, 200, 0, 20)
- keybindLabel.Position = UDim2.new(0, 10, 0, 130)
- keybindLabel.BackgroundTransparency = 1
- keybindLabel.Text = "Hide/Show Keybind: " .. GUI_VISIBILITY_KEYBIND.Name
- keybindLabel.Font = Enum.Font.Gotham
- keybindLabel.TextSize = 16
- keybindLabel.TextColor3 = Color3.fromRGB(230, 230, 230)
- keybindLabel.TextXAlignment = Enum.TextXAlignment.Left
- keybindLabel.Parent = settingsFrame
- local changeKeybindButton = Instance.new("TextButton")
- changeKeybindButton.Size = UDim2.new(0, 100, 0, 30)
- changeKeybindButton.Position = UDim2.new(0, 10, 0, 155)
- changeKeybindButton.BackgroundColor3 = Color3.fromRGB(0, 120, 200)
- changeKeybindButton.BorderSizePixel = 0
- changeKeybindButton.Text = "Change Keybind"
- changeKeybindButton.Font = Enum.Font.Gotham
- changeKeybindButton.TextSize = 14
- changeKeybindButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- changeKeybindButton.Parent = settingsFrame
- local listeningForInput = false
- changeKeybindButton.MouseButton1Click:Connect(function()
- if not listeningForInput then
- listeningForInput = true
- keybindLabel.Text = "Press any key..."
- keybindLabel.TextColor3 = Color3.fromRGB(255, 255, 0) -- Żółty kolor, żeby było widać, że czeka na input
- local inputConnection
- inputConnection = UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
- if not gameProcessedEvent and input.UserInputType == Enum.UserInputType.Keyboard then
- GUI_VISIBILITY_KEYBIND = input.KeyCode
- keybindLabel.Text = "Hide/Show Keybind: " .. GUI_VISIBILITY_KEYBIND.Name
- keybindLabel.TextColor3 = Color3.fromRGB(230, 230, 230) -- Przywróć domyślny kolor
- listeningForInput = false
- inputConnection:Disconnect() -- Odłączamy połączenie po otrzymaniu inputu
- end
- end)
- end
- end)
- end)
- btnCredits.MouseButton1Click:Connect(function()
- setActivePage(creditsFrame)
- local creditsLabel = Instance.new("TextLabel")
- creditsLabel.Size = UDim2.new(1, -20, 0, 40)
- creditsLabel.Position = UDim2.new(0, 10, 0, 10)
- creditsLabel.BackgroundTransparency = 1
- creditsLabel.Text = "Credits"
- creditsLabel.Font = Enum.Font.GothamBold
- creditsLabel.TextSize = 24
- creditsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- creditsLabel.TextXAlignment = Enum.TextXAlignment.Left
- creditsLabel.Parent = creditsFrame
- local creditsText = Instance.new("TextLabel")
- creditsText.Size = UDim2.new(1, -20, 0, 100)
- creditsText.Position = UDim2.new(0, 10, 0, 60)
- creditsText.BackgroundTransparency = 1
- creditsText.Text = "GUI Design by [NYTHIC]\nAuto-farm Logic by [ME]\nSpecial Thanks to Roblox Using my script!"
- creditsText.Font = Enum.Font.Gotham
- creditsText.TextSize = 14
- creditsText.TextColor3 = Color3.fromRGB(200, 200, 200)
- creditsText.TextWrapped = true
- creditsText.TextXAlignment = Enum.TextXAlignment.Left
- creditsText.TextYAlignment = Enum.TextYAlignment.Top
- creditsText.Parent = creditsFrame
- end)
- --- LOGIKA PRZECIĄGANIA GUI ---
- local dragging = false
- local dragStart = Vector2.new(0,0)
- local initialPosition = UDim2.new(0,0,0,0)
- mainFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- initialPosition = mainFrame.Position
- UserInputService.MouseIconEnabled = false
- UserInputService.MouseIcon = "rbxassetid://60505166" -- Ikona ręki lub inna pasująca
- end
- end)
- mainFrame.InputChanged:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and dragging then
- local delta = input.Position - dragStart
- local newX = initialPosition.X.Offset + delta.X
- local newY = initialPosition.Y.Offset + delta.Y
- mainFrame.Position = UDim2.new(0, newX, 0, newY)
- end
- end)
- mainFrame.InputEnded:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and dragging then
- dragging = false
- UserInputService.MouseIconEnabled = true
- UserInputService.MouseIcon = "" -- Domyślna ikona myszy
- end
- end)
- --- OBSŁUGA KLAWISZY (KEYBINDS) ---
- UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
- if input.KeyCode == GUI_VISIBILITY_KEYBIND and not gameProcessedEvent then
- screenGui.Enabled = not screenGui.Enabled
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement