Aller au contenu
Fonctionnel

Cool Gym Game autofarm Xeno supported

CLclarkdevlinorg1 vuesUniversal26 juil. 2026
Partager
Cool Gym Game autofarm Xeno supported

Code du script

Lua
-- Cool gym autofarm - Walking System + Auto Clean

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

local autoFarm = false

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = player:WaitForChild("PlayerGui")

local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 290, 0, 180)
Frame.Position = UDim2.new(0.76, 0, 0.1, 0)
Frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
Frame.BorderSizePixel = 0
Frame.Parent = ScreenGui

local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, 0, 0, 40)
Title.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Title.Text = "Cool Gym Auto Farm v10"
Title.TextColor3 = Color3.new(1,1,1)
Title.Font = Enum.Font.GothamBold
Title.TextSize = 16
Title.Parent = Frame

local ToggleBtn = Instance.new("TextButton")
ToggleBtn.Size = UDim2.new(0.85, 0, 0, 55)
ToggleBtn.Position = UDim2.new(0.075, 0, 0.32, 0)
ToggleBtn.BackgroundColor3 = Color3.fromRGB(170, 0, 0)
ToggleBtn.Text = "START AUTO FARM"
ToggleBtn.TextColor3 = Color3.new(1,1,1)
ToggleBtn.Font = Enum.Font.GothamBold
ToggleBtn.TextSize = 16
ToggleBtn.Parent = Frame

local Status = Instance.new("TextLabel")
Status.Size = UDim2.new(1, 0, 0, 40)
Status.Position = UDim2.new(0, 0, 0.7, 0)
Status.BackgroundTransparency = 1
Status.Text = "Status: OFF"
Status.TextColor3 = Color3.fromRGB(255, 80, 80)
Status.Font = Enum.Font.Gotham
Status.TextSize = 14
Status.Parent = Frame

local function updateButton()
	if autoFarm then
		ToggleBtn.Text = "STOP AUTO FARM"
		ToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 0)
		Status.Text = "Searching for mess..."
		Status.TextColor3 = Color3.fromRGB(0, 255, 100)
	else
		ToggleBtn.Text = "START AUTO FARM"
		ToggleBtn.BackgroundColor3 = Color3.fromRGB(170, 0, 0)
		Status.Text = "Status: OFF"
		Status.TextColor3 = Color3.fromRGB(255, 80, 80)
	end
end

local function refreshCharacter()
	character = player.Character or player.CharacterAdded:Wait()
	humanoid = character:WaitForChild("Humanoid")
	root = character:WaitForChild("HumanoidRootPart")
end

local function isMessObject(obj)
	if not obj:IsA("BasePart") then return false end

	local name = obj.Name:lower()

	return name == "mess1"
		or name:find("water")
		or name:find("bottle")
		or name:find("puddle")
		or name:find("spill")
		or name:find("liquid")
end

local function findClosestMess()
	local closest = nil
	local shortest = math.huge

	for _, obj in ipairs(workspace:GetDescendants()) do
		if isMessObject(obj) then
			local dist = (root.Position - obj.Position).Magnitude

			if dist < shortest and dist < 150 then
				shortest = dist
				closest = obj
			end
		end
	end

	return closest
end

local function walkToPart(part)
	if not part or not part:IsDescendantOf(workspace) then
		return false
	end

	local reached = false
	local finished = false

	humanoid:MoveTo(part.Position)

	local conn
	conn = humanoid.MoveToFinished:Connect(function(success)
		reached = success
		finished = true
	end)

	local startTime = tick()

	while autoFarm and humanoid.Health > 0 and not finished do
		if not part:IsDescendantOf(workspace) then
			break
		end

		if tick() - startTime > 8 then
			break
		end

		task.wait(0.1)
	end

	if conn then
		conn:Disconnect()
	end

	return reached
end

local function cleanMess(mess)
	if not mess or not mess:IsDescendantOf(workspace) then return end

	root.CFrame = CFrame.lookAt(root.Position, mess.Position)

	local prompt = mess:FindFirstChildOfClass("ProximityPrompt")

	if not prompt and mess.Parent then
		prompt = mess.Parent:FindFirstChildOfClass("ProximityPrompt")
	end

	if prompt then
		fireproximityprompt(prompt, 2.5)
	end
end

ToggleBtn.MouseButton1Click:Connect(function()
	autoFarm = not autoFarm
	updateButton()

	if autoFarm then
		refreshCharacter()

		while autoFarm and humanoid.Health > 0 do
			local closest = findClosestMess()

			if closest then
				Status.Text = "Walking to: " .. closest.Name

				local reached = walkToPart(closest)

				if reached and autoFarm then
					Status.Text = "Cleaning: " .. closest.Name
					cleanMess(closest)
					task.wait(0.6)
				else
					Status.Text = "Could not reach mess"
					task.wait(0.5)
				end
			else
				humanoid:Move(Vector3.new(0, 0, 0), false)
				Status.Text = "No mess found..."
				task.wait(1)
			end
		end
	else
		if humanoid then
			humanoid:Move(Vector3.new(0, 0, 0), false)
		end
	end
end)

Description

you need to zoom out to make this script work

Commentaires (0)

Connectez-vous pour participer à la conversation

  • Soyez le premier à commenter.

Questions fréquentes

Comment utiliser le script Cool Gym Game autofarm Xeno supported ?
Copiez le code ci-dessus, ouvrez votre exécuteur Roblox, collez le code et appuyez sur exécuter pendant que vous êtes dans le jeu. Les fonctionnalités s'activent instantanément une fois le script lancé.
Le script Cool Gym Game autofarm Xeno supported est-il gratuit ?
Oui. Ce script est gratuit à copier et utiliser. S'il utilise un système de clé, suivez le lien « Obtenir la clé » pour le débloquer gratuitement.
Le script Cool Gym Game autofarm Xeno supported est-il sûr à utiliser ?
Le code source complet est affiché sur cette page pour que vous puissiez lire exactement ce qu'il fait avant de l'exécuter. Utilisez toujours un exécuteur de confiance, et n'oubliez pas que l'utilisation de scripts est contraire aux conditions d'utilisation de Roblox — utilisez-les à vos propres risques.
Quel exécuteur fonctionne avec Cool Gym Game autofarm Xeno supported ?
Ce script fonctionne avec la plupart des exécuteurs Roblox populaires. Consultez notre page d'exécuteurs pour trouver un exécuteur gratuit ou payant fiable pour votre appareil.
Cool Gym Game autofarm Xeno supported | BloxScripter