
Animal SimulatorNO KEY

Tested by bebra · BobloScript editorial team · Dec 4, 2026
Test setup: PC, Android · Potassium, Delta
All 4 listed features checked
No failures found.
Tested on PC using Potassium and on Android using Delta. The coin farm successfully navigated under the map, collected coins, and updated the UI counters. The K toggle and auto-stop on death functioned correctly.
This reflects one test at a specific point in time, not an ongoing guarantee. How we test scripts
1--[[2 Coin Farm — tween teleport to coins3 -----------------------------------4 How it works:5 1. The character drops a bit below the map, so nobody above can see it.6 2. A tween moves it under the chosen coin.7 3. It rises to the coin and holds there for a moment — the coin is collected.8 4. It drops back down and flies to the next one.910 Toggle with the window button or the K key.11]]1213local Players = game:GetService("Players")14local RunService = game:GetService("RunService")15local UserInputService = game:GetService("UserInputService")1617local LocalPlayer = Players.LocalPlayer1819local CONFIG = {20 travelSpeed = 320, -- speed of the flight under the map, studs/sec21 riseSpeed = 150, -- speed of the climb to a coin, studs/sec22 sinkDepth = 22, -- how far below the map to sink23 holdTime = 0.5, -- seconds spent on a coin24 idleWait = 2, -- pause when there are no coins left25 toggleKey = Enum.KeyCode.K,26}2728local THEME = {29 background = Color3.fromRGB(20, 21, 26),30 card = Color3.fromRGB(28, 30, 38),31 stroke = Color3.fromRGB(52, 56, 68),32 text = Color3.fromRGB(236, 237, 242),33 muted = Color3.fromRGB(146, 151, 165),34 accent = Color3.fromRGB(255, 198, 58),35 accentText = Color3.fromRGB(30, 24, 6),36 danger = Color3.fromRGB(232, 92, 92),37}3839local state = {40 running = false,41 collected = 0,42 skipped = 0,43 status = "Ready",44 lastSurfacePosition = nil,45}4647local function getCharacterParts()48 local character = LocalPlayer.Character49 if not character then50 return nil, nil, nil51 end52 local humanoid = character:FindFirstChildOfClass("Humanoid")53 local rootPart = character:FindFirstChild("HumanoidRootPart")54 if not humanoid or not rootPart or humanoid.Health <= 0 then55 return nil, nil, nil56 end57 return character, humanoid, rootPart58end5960local function getCoinContainer()61 return workspace:FindFirstChild("CoinContainer")62end6364local function isCoinGone(coin)65 return coin == nil or coin.Parent == nil or coin.Transparency > 0.566end6768local function getAvailableCoins()69 local container = getCoinContainer()70 local coins = {}71 if not container then72 return coins73 end74 for _, model in ipairs(container:GetChildren()) do75 local coin = model:FindFirstChild("Coin")76 if coin and coin:IsA("BasePart") and not isCoinGone(coin) then77 table.insert(coins, coin)78 end79 end80 return coins81end8283local function findNearestCoin()84 local _, _, rootPart = getCharacterParts()85 local origin = rootPart and rootPart.Position or Vector3.zero86 local best, bestDistance = nil, math.huge87 for _, coin in ipairs(getAvailableCoins()) do88 local position = coin.Position89 local delta = Vector3.new(position.X - origin.X, 0, position.Z - origin.Z)90 local distance = delta.Magnitude91 if distance < bestDistance then92 best, bestDistance = coin, distance93 end94 end95 return best96end9798local function buildRaycastFilter()99 local filter = {}100 local character = LocalPlayer.Character101 if character then102 table.insert(filter, character)103 end104 local container = getCoinContainer()105 if container then106 table.insert(filter, container)107 end108 for _, player in ipairs(Players:GetPlayers()) do109 if player ~= LocalPlayer and player.Character then110 table.insert(filter, player.Character)111 end112 end113 return filter114end115116local function getGroundHeight(position: Vector3): number117 local parameters = RaycastParams.new()118 parameters.FilterType = Enum.RaycastFilterType.Exclude119 parameters.FilterDescendantsInstances = buildRaycastFilter()120121 local result = workspace:Raycast(position + Vector3.new(0, 6, 0), Vector3.new(0, -200, 0), parameters)122 if result then123 return result.Position.Y124 end125 return position.Y - 2126end127128local function getSurfaceHeight(position: Vector3): number129 local parameters = RaycastParams.new()130 parameters.FilterType = Enum.RaycastFilterType.Exclude131 parameters.FilterDescendantsInstances = buildRaycastFilter()132133 local result = workspace:Raycast(Vector3.new(position.X, 1000, position.Z), Vector3.new(0, -1500, 0), parameters)134 if result then135 return result.Position.Y136 end137 return 650138end139140-- Smoothly drives the root part to a point. The root part stays anchored while141-- flying, so the character cannot fall into the void or clip through the map.142local function moveTo(targetPosition: Vector3, speed: number): boolean143 local _, _, rootPart = getCharacterParts()144 if not rootPart then145 return false146 end147148 rootPart.Anchored = true149150 local startPosition = rootPart.Position151 local distance = (targetPosition - startPosition).Magnitude152 if distance < 0.6 then153 return true154 end155156 local horizontal = Vector3.new(targetPosition.X - startPosition.X, 0, targetPosition.Z - startPosition.Z)157 local rotation158 if horizontal.Magnitude > 2 then159 rotation = CFrame.lookAt(Vector3.zero, horizontal.Unit)160 else161 rotation = rootPart.CFrame - rootPart.CFrame.Position162 end163164 local duration = distance / math.max(speed, 15)165 local elapsed = 0166 local finished = false167168 local connection = RunService.Heartbeat:Connect(function(deltaTime)169 if finished then170 return171 end172 elapsed += deltaTime173 local alpha = math.min(elapsed / duration, 1)174 local position = startPosition:Lerp(targetPosition, alpha)175 rootPart.CFrame = CFrame.new(position) * rotation176 rootPart.AssemblyLinearVelocity = Vector3.zero177 if alpha >= 1 then178 finished = true179 end180 end)181182 while not finished do183 if not state.running or not rootPart.Parent then184 break185 end186 task.wait()187 end188189 connection:Disconnect()190 return finished191end192193-- Short stop on a coin. Here the root part is unanchored on purpose:194-- the server only registers a coin touch for a "live" character.195local function holdAtCoin(position: Vector3)196 local _, _, rootPart = getCharacterParts()197 if not rootPart then198 return199 end200201 local rotation = rootPart.CFrame - rootPart.CFrame.Position202 rootPart.Anchored = false203204 local startedAt = os.clock()205 local connection206 connection = RunService.Heartbeat:Connect(function()207 if os.clock() - startedAt > CONFIG.holdTime then208 return209 end210 local wobble = math.sin((os.clock() - startedAt) * 25) * 1.2211 rootPart.CFrame = CFrame.new(position + Vector3.new(wobble, 0, 0)) * rotation212 rootPart.AssemblyLinearVelocity = Vector3.zero213 end)214215 task.wait(CONFIG.holdTime)216 connection:Disconnect()217218 if rootPart.Parent then219 rootPart.Anchored = true220 end221end222223-- Puts the character back on the surface and unanchors it.224local function releaseCharacter()225 local _, _, rootPart = getCharacterParts()226 if not rootPart then227 return228 end229230 local position = rootPart.Position231 local anchorPosition = state.lastSurfacePosition232 local surfaceX, surfaceZ233234 if anchorPosition then235 surfaceX, surfaceZ = anchorPosition.X, anchorPosition.Z236 else237 surfaceX, surfaceZ = position.X, position.Z238 end239240 local groundY = getSurfaceHeight(Vector3.new(surfaceX, position.Y, surfaceZ))241 rootPart.Anchored = true242 rootPart.CFrame = CFrame.new(Vector3.new(surfaceX, groundY + 3.2, surfaceZ))243 rootPart.AssemblyLinearVelocity = Vector3.zero244 task.wait(0.05)245 if rootPart.Parent then246 rootPart.Anchored = false247 end248end249250local setStatus251local refreshCounters252local refreshToggle253254local function collectCoin(coin): boolean255 local _, _, rootPart = getCharacterParts()256 if not rootPart then257 return false258 end259260 local coinPosition = coin.Position261 local groundY = getGroundHeight(coinPosition)262 local underPosition = Vector3.new(coinPosition.X, groundY - CONFIG.sinkDepth, coinPosition.Z)263264 -- 1. Sink below the map265 setStatus("Going under the map")266 local startSurfaceY = getGroundHeight(rootPart.Position)267 if not moveTo(Vector3.new(rootPart.Position.X, startSurfaceY - CONFIG.sinkDepth, rootPart.Position.Z), CONFIG.travelSpeed) then268 return false269 end270271 -- 2. Tween under the coin272 setStatus("Flying to the coin")273 if not moveTo(underPosition, CONFIG.travelSpeed) then274 return false275 end276277 -- 3. Rise to the coin278 setStatus("Rising to the coin")279 if not moveTo(coinPosition + Vector3.new(0, 1, 0), CONFIG.riseSpeed) then280 return false281 end282283 -- 4. Collect it284 setStatus("Collecting coin")285 holdAtCoin(coinPosition + Vector3.new(0, 1, 0))286 if not isCoinGone(coin) then287 holdAtCoin(coinPosition + Vector3.new(0, 2.5, 0))288 end289290 state.lastSurfacePosition = Vector3.new(coinPosition.X, coinPosition.Y, coinPosition.Z)291 return isCoinGone(coin)292end293294local function farmLoop()295 while state.running do296 local character, humanoid = getCharacterParts()297 if not character or not humanoid then298 setStatus("Character lost — stopped")299 break300 end301302 local coin = findNearestCoin()303 if not coin then304 setStatus("Waiting for coin respawn")305 task.wait(CONFIG.idleWait)306 continue307 end308309 if collectCoin(coin) then310 state.collected += 1311 else312 state.skipped += 1313 end314 refreshCounters()315 end316end317318local gui319local statusLabel320local counterLabel321local toggleButton322323local function make(className, properties, parent)324 local instance = Instance.new(className)325 for key, value in pairs(properties) do326 instance[key] = value327 end328 if parent then329 instance.Parent = parent330 end331 return instance332end333334refreshCounters = function()335 if counterLabel then336 counterLabel.Text = string.format("Collected: %d · Skipped: %d", state.collected, state.skipped)337 end338end339340setStatus = function(text: string)341 state.status = text342 if statusLabel then343 statusLabel.Text = text344 end345end346347refreshToggle = function()348 if not toggleButton then349 return350 end351 if state.running then352 toggleButton.Text = "Stop · K"353 toggleButton.BackgroundColor3 = THEME.danger354 toggleButton.TextColor3 = Color3.fromRGB(255, 245, 245)355 else356 toggleButton.Text = "Start · K"357 toggleButton.BackgroundColor3 = THEME.accent358 toggleButton.TextColor3 = THEME.accentText359 end360end361362local function addSetting(parentFrame, labelText: string, value: number, offsetX: number, onApply)363 make("TextLabel", {364 Position = UDim2.new(0, offsetX, 0, 140),365 Size = UDim2.fromOffset(60, 12),366 BackgroundTransparency = 1,367 Font = Enum.Font.GothamMedium,368 Text = labelText,369 TextSize = 10,370 TextColor3 = THEME.muted,371 TextXAlignment = Enum.TextXAlignment.Left,372 }, parentFrame)373374 local box = make("TextBox", {375 Position = UDim2.new(0, offsetX, 0, 154),376 Size = UDim2.fromOffset(60, 22),377 BackgroundColor3 = THEME.card,378 BorderSizePixel = 0,379 Font = Enum.Font.GothamMedium,380 Text = tostring(value),381 TextSize = 12,382 TextColor3 = THEME.text,383 ClearTextOnFocus = false,384 }, parentFrame)385 make("UICorner", { CornerRadius = UDim.new(0, 6) }, box)386 make("UIStroke", { Color = THEME.stroke, Thickness = 1, Transparency = 0.2 }, box)387388 box.FocusLost:Connect(function()389 local parsed = tonumber(box.Text)390 local applied = parsed and onApply(parsed) or nil391 box.Text = tostring(applied or value)392 end)393end394395local startFarm396local stopFarm397398local function buildGui()399 local playerGui = LocalPlayer:WaitForChild("PlayerGui")400 local old = playerGui:FindFirstChild("CoinFarmGui")401 if old then402 old:Destroy()403 end404405 gui = make("ScreenGui", {406 Name = "CoinFarmGui",407 ResetOnSpawn = false,408 IgnoreGuiInset = true,409 ZIndexBehavior = Enum.ZIndexBehavior.Sibling,410 DisplayOrder = 50,411 }, playerGui)412413 local window = make("Frame", {414 Name = "Window",415 Size = UDim2.fromOffset(236, 190),416 Position = UDim2.new(0.5, 0, 0.5, 0),417 AnchorPoint = Vector2.new(0.5, 0.5),418 BackgroundColor3 = THEME.background,419 BorderSizePixel = 0,420 Active = true,421 }, gui)422423 make("UICorner", { CornerRadius = UDim.new(0, 12) }, window)424 make("UIStroke", { Color = THEME.stroke, Thickness = 1, Transparency = 0.15 }, window)425426 local header = make("Frame", {427 Name = "Header",428 Size = UDim2.new(1, 0, 0, 34),429 BackgroundColor3 = THEME.card,430 BorderSizePixel = 0,431 }, window)432 make("UICorner", { CornerRadius = UDim.new(0, 12) }, header)433 make("Frame", {434 Size = UDim2.new(1, 0, 0, 14),435 Position = UDim2.new(0, 0, 1, -14),436 BackgroundColor3 = THEME.card,437 BorderSizePixel = 0,438 }, header)439440 make("TextLabel", {441 Position = UDim2.new(0, 14, 0, 0),442 Size = UDim2.new(1, -50, 1, 0),443 BackgroundTransparency = 1,444 Font = Enum.Font.GothamBold,445 Text = "Coin Farm",446 TextSize = 15,447 TextColor3 = THEME.text,448 TextXAlignment = Enum.TextXAlignment.Left,449 }, header)450451 local closeButton = make("TextButton", {452 Size = UDim2.fromOffset(26, 26),453 Position = UDim2.new(1, -32, 0, 4),454 BackgroundTransparency = 1,455 Font = Enum.Font.GothamBold,456 Text = "×",457 TextSize = 18,458 TextColor3 = THEME.muted,459 }, header)460 closeButton.MouseEnter:Connect(function()461 closeButton.TextColor3 = THEME.text462 end)463 closeButton.MouseLeave:Connect(function()464 closeButton.TextColor3 = THEME.muted465 end)466 closeButton.MouseButton1Click:Connect(function()467 stopFarm()468 if gui then469 gui:Destroy()470 end471 end)472473 statusLabel = make("TextLabel", {474 Position = UDim2.new(0, 14, 0, 46),475 Size = UDim2.new(1, -28, 0, 16),476 BackgroundTransparency = 1,477 Font = Enum.Font.GothamMedium,478 Text = state.status,479 TextSize = 12,480 TextColor3 = THEME.muted,481 TextXAlignment = Enum.TextXAlignment.Left,482 }, window)483484 counterLabel = make("TextLabel", {485 Position = UDim2.new(0, 14, 0, 66),486 Size = UDim2.new(1, -28, 0, 16),487 BackgroundTransparency = 1,488 Font = Enum.Font.GothamBold,489 Text = "Collected: 0 · Skipped: 0",490 TextSize = 12,491 TextColor3 = THEME.text,492 TextXAlignment = Enum.TextXAlignment.Left,493 }, window)494495 toggleButton = make("TextButton", {496 Position = UDim2.new(0, 14, 0, 92),497 Size = UDim2.new(1, -28, 0, 38),498 BackgroundColor3 = THEME.accent,499 BorderSizePixel = 0,500 Font = Enum.Font.GothamBold,501 Text = "Start · K",502 TextSize = 14,503 TextColor3 = THEME.accentText,504 AutoButtonColor = true,505 }, window)506 make("UICorner", { CornerRadius = UDim.new(0, 9) }, toggleButton)507 toggleButton.MouseButton1Click:Connect(function()508 if state.running then509 stopFarm()510 else511 startFarm()512 end513 end)514515 addSetting(window, "Depth", CONFIG.sinkDepth, 14, function(value)516 CONFIG.sinkDepth = math.clamp(value, 5, 80)517 return CONFIG.sinkDepth518 end)519 addSetting(window, "Speed", CONFIG.travelSpeed, 88, function(value)520 CONFIG.travelSpeed = math.clamp(value, 60, 900)521 return CONFIG.travelSpeed522 end)523 addSetting(window, "Climb", CONFIG.riseSpeed, 162, function(value)524 CONFIG.riseSpeed = math.clamp(value, 40, 600)525 return CONFIG.riseSpeed526 end)527528 -- Window dragging529 local dragging = false530 local dragStart531 local startPosition532 header.InputBegan:Connect(function(input)533 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then534 dragging = true535 dragStart = input.Position536 startPosition = window.Position537 input.Changed:Connect(function()538 if input.UserInputState == Enum.UserInputState.End then539 dragging = false540 end541 end)542 end543 end)544 UserInputService.InputChanged:Connect(function(input)545 if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then546 local delta = input.Position - dragStart547 window.Position = UDim2.new(548 startPosition.X.Scale,549 startPosition.X.Offset + delta.X,550 startPosition.Y.Scale,551 startPosition.Y.Offset + delta.Y552 )553 end554 end)555end556557startFarm = function()558 if state.running then559 return560 end561 local _, _, rootPart = getCharacterParts()562 if not rootPart then563 setStatus("Character not loaded")564 return565 end566567 state.running = true568 state.collected = 0569 state.skipped = 0570 state.lastSurfacePosition = nil571 refreshCounters()572 refreshToggle()573 setStatus("Starting")574575 task.spawn(function()576 local ok, err = pcall(farmLoop)577 state.running = false578 releaseCharacter()579 refreshToggle()580 if ok then581 setStatus("Ready")582 else583 setStatus("Error: " .. tostring(err))584 end585 end)586end587588stopFarm = function()589 if not state.running then590 return591 end592 state.running = false593 setStatus("Stopping")594 task.delay(0.25, function()595 releaseCharacter()596 refreshToggle()597 setStatus("Ready")598 end)599end600601if _G.CoinFarm and _G.CoinFarm.stop then602 pcall(_G.CoinFarm.stop)603end604605buildGui()606refreshToggle()607refreshCounters()608609UserInputService.InputBegan:Connect(function(input, gameProcessed)610 if gameProcessed then611 return612 end613 if input.KeyCode == CONFIG.toggleKey then614 if state.running then615 stopFarm()616 else617 startFarm()618 end619 end620end)621622LocalPlayer.CharacterAdded:Connect(function()623 if state.running then624 state.running = false625 refreshToggle()626 setStatus("Character died — stopped")627 end628end)629630_G.CoinFarm = {631 start = startFarm,632 stop = stopFarm,633 config = CONFIG,634 state = state,635}636637setStatus("Ready")638print("[CoinFarm] loaded")Animal Simulator requires collecting vast amounts of coins to unlock new areas and pets. This script automates the collection process by moving your character through a specific path: sinking below the map to avoid other players, flying under the target coin, and rising to collect it before repeating.
The window provides three adjustable values. Depth controls how far below the map the character travels (default 22). Speed dictates the horizontal travel speed (default 320), and Climb controls the vertical rise speed (default 150). Adjusting these can help bypass specific map geometries or optimize the collection loop.
A small window tracks your progress, showing the current status (e.g., waiting for respawn, flying to coin), number of coins collected, and skipped coins. You can toggle the farm using the on-screen button or the K key. If your character dies, the script automatically stops to prevent falling into the void.
by ragnar9878 · 1 script · 8 views
Comments
Loading comments…