Загрузка данных


-- Xeno Auto Farm Script with GUI Toggle via Right Shift
-- Attach to a LocalScript in StarterGui.

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

-- Configuration
local FARM_TARGET = 5000
local XENO_ENABLED = true
local CLICK_INTERVAL = 0.012

-- Remote events
local treasureRemote = ReplicatedStorage:FindFirstChild("TreasureClick") or ReplicatedStorage:FindFirstChild("RemoteEvent")
local claimRemote = ReplicatedStorage:FindFirstChild("ClaimReward") or ReplicatedStorage:FindFirstChild("RewardRemote")

-- GUI Creation
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "XenoFarmGUI"
screenGui.Parent = player:WaitForChild("PlayerGui")

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 300, 0, 200)
frame.Position = UDim2.new(0.5, -150, 0.5, -100)
frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
frame.BackgroundTransparency = 0.1
frame.BorderSizePixel = 2
frame.BorderColor3 = Color3.fromRGB(255, 170, 0)
frame.Visible = false  -- Hidden by default
frame.Parent = screenGui

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, 0, 0, 30)
title.Position = UDim2.new(0, 0, 0, 5)
title.BackgroundTransparency = 1
title.Text = "Xeno Farm v1.0"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.TextSize = 18
title.Font = Enum.Font.SourceSansBold
title.Parent = frame

local statusLabel = Instance.new("TextLabel")
statusLabel.Size = UDim2.new(1, 0, 0, 25)
statusLabel.Position = UDim2.new(0, 0, 0, 40)
statusLabel.BackgroundTransparency = 1
statusLabel.Text = "Status: OFF"
statusLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
statusLabel.TextSize = 14
statusLabel.Font = Enum.Font.SourceSans
statusLabel.Parent = frame

local rateLabel = Instance.new("TextLabel")
rateLabel.Size = UDim2.new(1, 0, 0, 25)
rateLabel.Position = UDim2.new(0, 0, 0, 70)
rateLabel.BackgroundTransparency = 1
rateLabel.Text = "Rate: 0 gold/min"
rateLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
rateLabel.TextSize = 14
rateLabel.Font = Enum.Font.SourceSans
rateLabel.Parent = frame

local toggleButton = Instance.new("TextButton")
toggleButton.Size = UDim2.new(0, 120, 0, 35)
toggleButton.Position = UDim2.new(0.5, -60, 0, 110)
toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
toggleButton.Text = "START"
toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
toggleButton.TextSize = 16
toggleButton.Font = Enum.Font.SourceSansBold
toggleButton.Parent = frame

local closeButton = Instance.new("TextButton")
closeButton.Size = UDim2.new(0, 60, 0, 25)
closeButton.Position = UDim2.new(1, -70, 0, 5)
closeButton.BackgroundColor3 = Color3.fromRGB(100, 30, 30)
closeButton.Text = "X"
closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
closeButton.TextSize = 14
closeButton.Font = Enum.Font.SourceSansBold
closeButton.Parent = frame

-- Farm state
local farmActive = false
local clickCounter = 0
local startTime = tick()

-- Core functions
local function sendClick()
    if not treasureRemote then return end
    local args = { ["clickType"] = "Normal", ["xenoBoost"] = XENO_ENABLED }
    treasureRemote:FireServer(unpack(args))
    clickCounter = clickCounter + 1
end

local function farmLoop()
    if not farmActive then return end
    if not character or not character.Parent then
        character = player.CharacterAdded:Wait()
        humanoid = character:WaitForChild("Humanoid")
        return
    end
    for i = 1, 3 do sendClick() end
    if clickCounter % 50 == 0 and claimRemote then claimRemote:FireServer() end
    local elapsed = tick() - startTime
    if elapsed >= 60 then
        local rate = (clickCounter / elapsed) * 60
        rateLabel.Text = "Rate: " .. tostring(math.floor(rate)) .. " gold/min"
        if rate >= FARM_TARGET then
            statusLabel.Text = "Status: TARGET MET"
            statusLabel.TextColor3 = Color3.fromRGB(100, 255, 100)
        else
            statusLabel.Text = "Status: FARMING"
            statusLabel.TextColor3 = Color3.fromRGB(255, 255, 100)
        end
        clickCounter = 0
        startTime = tick()
    end
end

-- Toggle farm state
local function toggleFarm()
    farmActive = not farmActive
    if farmActive then
        toggleButton.Text = "STOP"
        toggleButton.BackgroundColor3 = Color3.fromRGB(150, 50, 50)
        statusLabel.Text = "Status: FARMING"
        statusLabel.TextColor3 = Color3.fromRGB(255, 255, 100)
        startTime = tick()
        clickCounter = 0
    else
        toggleButton.Text = "START"
        toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
        statusLabel.Text = "Status: OFF"
        statusLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
    end
end

-- Button connections
toggleButton.MouseButton1Click:Connect(toggleFarm)
closeButton.MouseButton1Click:Connect(function()
    screenGui:Destroy()
end)

-- RIGHT SHIFT to open/close GUI
UserInputService.InputBegan:Connect(function(input, processed)
    if processed then return end
    if input.KeyCode == Enum.KeyCode.RightShift then
        frame.Visible = not frame.Visible
    end
end)

-- Run loop
RunService.Heartbeat:Connect(farmLoop)

print("[Xeno Farm] Loaded. Press RIGHT SHIFT to toggle GUI.")