ADVERTISEMENTREMOVE ADS
Game icon

minichests

Kitten Game 🐾
3 months ago
Script preview thumbnail
Script Preview

Description

Start script to farm minichests!

Features:

  • autofarm mini chests
ADVERTISEMENTREMOVE ADS
127 Lines • 4.01 KiB
Raw
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local TeleportDelay = 2
local running = false
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "AutoTeleportGUI"
ScreenGui.Parent = player.PlayerGui
local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 200, 0, 80)
Frame.Position = UDim2.new(0.5, -100, 0, 10)
Frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
Frame.BorderSizePixel = 0
Frame.Active = true
Frame.Draggable = true
Frame.Selectable = true
Frame.Parent = ScreenGui
local DragHandle = Instance.new("TextLabel")
DragHandle.Name = "DragHandle"
DragHandle.Text = "Kitten game"
DragHandle.Size = UDim2.new(1, 0, 0, 25)
DragHandle.Position = UDim2.new(0, 0, 0, 0)
DragHandle.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
DragHandle.TextColor3 = Color3.fromRGB(255, 255, 255)
DragHandle.Font = Enum.Font.SourceSansBold
DragHandle.TextSize = 12
DragHandle.Parent = Frame
local CloseButton = Instance.new("TextButton")
CloseButton.Name = "CloseButton"
CloseButton.Text = "X"
CloseButton.Size = UDim2.new(0, 25, 0, 25)
CloseButton.Position = UDim2.new(1, -25, 0, 0)
CloseButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
CloseButton.Font = Enum.Font.SourceSansBold
CloseButton.TextSize = 14
CloseButton.Parent = Frame
local ToggleButton = Instance.new("TextButton")
ToggleButton.Size = UDim2.new(0.8, 0, 0, 30)
ToggleButton.Position = UDim2.new(0.1, 0, 0.5, 0)
ToggleButton.Text = "Включить"
ToggleButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.Parent = Frame
local function getHumanoidRootPart()
local character = player.Character
if not character then
character = player.CharacterAdded:Wait()
end
return character:WaitForChild("HumanoidRootPart")
end
local function FindDesks()
local desks = {}
for i = 2, 7 do
local desk = Workspace:FindFirstChild("chest_"..i, true)
if desk and desk:IsA("BasePart") then
table.insert(desks, desk)
end
end
if #desks == 0 then
for _, desc in ipairs(Workspace:GetDescendants()) do
if desc:IsA("BasePart") then
local lowerName = desc.Name:lower()
if lowerName:find("chest_") or lowerName:find("chest_") or lowerName:find("chest_") then
table.insert(desks, desc)
end
end
end
end
return desks
end
local function teleportLoop()
while running do
local success, err = pcall(function()
local humanoidRootPart = getHumanoidRootPart()
local desks = FindDesks()
if #desks > 0 then
local randomDesk = desks[math.random(1, #desks)]
humanoidRootPart.CFrame = randomDesk.CFrame * CFrame.new(0, 3, 0)
print("[TELEPORT] Moved to "..randomDesk.Name)
else
warn("[WARNING] No desks found! Retrying...")
end
end)
if not success then
warn("[ERROR] "..tostring(err))
end
task.wait(TeleportDelay)
end
end
ToggleButton.MouseButton1Click:Connect(function()
running = not running
if running then
ToggleButton.Text = "Выключить"
ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
coroutine.wrap(function()
local success, err = pcall(teleportLoop)
if not success then
warn("[CRITICAL ERROR] "..tostring(err))
end
end)()
else
ToggleButton.Text = "Включить"
ToggleButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
end
end)
CloseButton.MouseButton1Click:Connect(function()
ScreenGui:Destroy()
running = false
end)
ADVERTISEMENTREMOVE ADS

Comments

1 comment
to add a comment
tw

ai?????????????

0
0
ADVERTISEMENTREMOVE ADS