-- https://www.roblox.com/games/10846691679/Fireworks-Playground-BETA -- dev is R-77 local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local PPS = game:GetService("ProximityPromptService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local FOLDER_NAME = "RandomChests" local TELEPORT_OFFSET_Y = 4 local AUTO_INTERVAL = 0.35 local function getChar() local c = player.Character or player.CharacterAdded:Wait() return c, c:WaitForChild("HumanoidRootPart", 3), c:FindFirstChildOfClass("Humanoid") end local function isChestName(name: string?) return name and string.find(string.lower(name), "chest", 1, true) ~= nil end local function resolveBasePart(inst: Instance?): BasePart? if not inst then return nil end if inst:IsA("BasePart") then return inst end if inst:IsA("Model") then local m = inst :: Model if m.PrimaryPart then return m.PrimaryPart end return m:FindFirstChildWhichIsA("BasePart", true) end return nil end local function safeTeleportTo(part: BasePart) local char, hrp, hum = getChar() if not (char and hrp and hum) or hum.Health <= 0 then return end if not part or not part:IsDescendantOf(workspace) then return end local pos = part.Position + Vector3.new(0, TELEPORT_OFFSET_Y, 0) char:PivotTo(CFrame.new(pos, pos + part.CFrame.LookVector)) end local function findPromptIn(inst: Instance?): ProximityPrompt? if not inst then return nil end if inst:IsA("ProximityPrompt") then return inst end local direct = inst:FindFirstChildOfClass("ProximityPrompt") if direct then return direct end for _, d in ipairs(inst:GetDescendants()) do if d:IsA("ProximityPrompt") then return d end end return nil end local function getPromptNearPart(bp: BasePart?): ProximityPrompt? if not bp then return nil end local tries = { bp, bp.Parent, bp.Parent and bp.Parent.Parent } for _, t in ipairs(tries) do local p = findPromptIn(t) if p then return p end end return nil end local function firePrompt(prompt: ProximityPrompt?): boolean if not (prompt and prompt.Enabled) then return false end local ok = pcall(function() PPS:TriggerPrompt(prompt) end) if ok then return true end local dur = prompt.HoldDuration or 0 pcall(function() prompt:InputHoldBegin() end) task.wait((dur > 0 and dur or 0) + 0.05) pcall(function() prompt:InputHoldEnd() end) return true end local folder: Instance? = nil local rareParts: {BasePart} = {} local normalParts: {BasePart} = {} local allParts: {BasePart} = {} local function addChestModel(model: Instance) if not (model and model:IsA("Model") and isChestName(model.Name)) then return end local bp = resolveBasePart(model) if not bp then return end table.insert(allParts, bp) if model.Name == "RareChest" then table.insert(rareParts, bp) else table.insert(normalParts, bp) end end local function removeDescendantRefs(list: {BasePart}, root: Instance) for i = #list, 1, -1 do local bp = list[i] if (not bp) or bp == root or bp:IsDescendantOf(root) then table.remove(list, i) end end end local function rebuildCaches() table.clear(rareParts); table.clear(normalParts); table.clear(allParts) if not folder then return end for _, inst in ipairs(folder:GetDescendants()) do if inst:IsA("Model") and isChestName(inst.Name) then addChestModel(inst) end end end local function bindFolder(f: Instance) if folder == f then return end folder = f rebuildCaches() f.DescendantAdded:Connect(function(d: Instance) if d:IsA("Model") and isChestName(d.Name) then addChestModel(d) end end) f.DescendantRemoving:Connect(function(d: Instance) removeDescendantRefs(allParts, d) removeDescendantRefs(rareParts, d) removeDescendantRefs(normalParts, d) end) end task.spawn(function() while true do if not folder then local f = workspace:FindFirstChild(FOLDER_NAME) if f then bindFolder(f) end end task.wait(2) end end) local gui = Instance.new("ScreenGui") gui.Name = "R77_ChestGUI" gui.IgnoreGuiInset = true gui.ResetOnSpawn = false gui.Parent = playerGui local window = Instance.new("Frame") window.Name = "Window" window.Size = UDim2.fromOffset(300, 280) window.Position = UDim2.fromOffset(60, 60) window.BackgroundColor3 = Color3.fromRGB(24, 24, 28) window.BorderSizePixel = 0 window.Parent = gui local corner = Instance.new("UICorner"); corner.CornerRadius = UDim.new(0, 12); corner.Parent = window local pad = Instance.new("UIPadding"); pad.PaddingTop=UDim.new(0,10); pad.PaddingLeft=UDim.new(0,10); pad.PaddingRight=UDim.new(0,10); pad.PaddingBottom=UDim.new(0,10); pad.Parent = window local titleBar = Instance.new("Frame"); titleBar.Size = UDim2.new(1, 0, 0, 28); titleBar.BackgroundTransparency = 1; titleBar.Parent = window local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -24, 1, 0) title.BackgroundTransparency = 1 title.TextXAlignment = Enum.TextXAlignment.Left title.Font = Enum.Font.GothamBold title.TextSize = 16 title.TextColor3 = Color3.fromRGB(235, 235, 245) title.Text = "Made with love by R-77" title.Parent = titleBar local list = Instance.new("Frame"); list.Position = UDim2.fromOffset(0, 40); list.Size = UDim2.new(1, 0, 1, -80); list.BackgroundTransparency = 1; list.Parent = window local layout = Instance.new("UIListLayout"); layout.Padding = UDim.new(0, 10); layout.FillDirection = Enum.FillDirection.Vertical; layout.HorizontalAlignment = Enum.HorizontalAlignment.Center; layout.Parent = list local function makeBtn(text: string): TextButton local b = Instance.new("TextButton") b.Size = UDim2.new(1, -20, 0, 38) b.BackgroundColor3 = Color3.fromRGB(56, 56, 64) b.AutoButtonColor = true b.Font = Enum.Font.GothamSemibold b.TextSize = 16 b.TextColor3 = Color3.fromRGB(245, 245, 255) b.Text = text b.Parent = list local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, 10); c.Parent = b return b end local btnRareRandom = makeBtn("TP to random Rare Chest") local btnChestRandom = makeBtn("TP to random Chest") local btnAuto = makeBtn("AUTO COLLECT (OFF)") local btnChangeSrv = makeBtn("Change Server") local status = Instance.new("TextLabel") status.Size = UDim2.new(1, -20, 0, 20) status.Position = UDim2.new(0, 10, 1, -24) status.BackgroundTransparency = 1 status.Font = Enum.Font.Gotham status.TextSize = 14 status.TextColor3 = Color3.fromRGB(170, 170, 180) status.TextXAlignment = Enum.TextXAlignment.Left status.Text = "Ready." status.Parent = window do local dragging = false; local dragStart; local startPos local function begin(i) dragging = true; dragStart = i.Position; startPos = window.Position end local function update(i) if dragging and dragStart and startPos then local d = i.Position - dragStart window.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end titleBar.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then begin(i) end end) titleBar.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end) UIS.InputChanged:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch then update(i) end end) end local function pickRandom(list: {BasePart}): BasePart? if #list == 0 then return nil end return list[math.random(1, #list)] end local function randomRarePart(): BasePart? return pickRandom(rareParts) end local function randomNormalPart(): BasePart? return pickRandom(normalParts) end local function nearestPromptAndPart(): (ProximityPrompt?, BasePart?) local char, hrp = getChar() if not hrp then return nil, nil end local bestPrompt: ProximityPrompt? = nil local bestPart: BasePart? = nil local bestDist: number? = nil for _, bp in ipairs(allParts) do if bp and bp.Parent and (not folder or bp:IsDescendantOf(folder)) then local pr = getPromptNearPart(bp) if pr and pr.Enabled then local d = (bp.Position - hrp.Position).Magnitude if (not bestDist) or d < bestDist then bestDist = d; bestPrompt = pr; bestPart = bp end end end end return bestPrompt, bestPart end btnRareRandom.MouseButton1Click:Connect(function() status.Text = "Selecting random Rare Chest..." local bp = randomRarePart() if bp then status.Text = "Teleporting to Rare Chest..." safeTeleportTo(bp) status.Text = "Done." else status.Text = "No Rare Chests available." end end) btnChestRandom.MouseButton1Click:Connect(function() status.Text = "Selecting random Chest..." local bp = randomNormalPart() if bp then status.Text = "Teleporting to Chest..." safeTeleportTo(bp) status.Text = "Done." else status.Text = "No Chests available." end end) local autoOn = false local autoThread: thread? = nil local function runAuto() if autoThread then return end autoThread = task.spawn(function() while autoOn do local pr, bp = nearestPromptAndPart() if pr and bp then safeTeleportTo(bp) task.wait(0.05) firePrompt(pr) end task.wait(AUTO_INTERVAL) end end) end btnAuto.MouseButton1Click:Connect(function() autoOn = not autoOn btnAuto.Text = autoOn and "AUTO COLLECT (ON)" or "AUTO COLLECT (OFF)" status.Text = autoOn and "Auto-collect enabled." or "Auto-collect disabled." if autoOn then runAuto() else if autoThread then task.cancel(autoThread); autoThread = nil end end end) btnChangeSrv.MouseButton1Click:Connect(function() status.Text = "Changing server..." local ok, moduleOrErr = pcall(function() return loadstring(game:HttpGet("https://raw.githubusercontent.com/LeoKholYt/roblox/main/lk_serverhop.lua"))() end) if ok and typeof(moduleOrErr) == "table" and moduleOrErr.Teleport then moduleOrErr:Teleport(game.PlaceId) else status.Text = "Server change failed." end end)