
Key Required

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local BOX_FOLDER = workspace:WaitForChild("BoxFolder")
local BOX_NAME = "MythicalBox"
local SAFE_HEIGHT = 5 -- safe above floor to avoid clipping
local TELEPORT_STEP = 2 -- distance in front of box to prevent camera black
-- Get character and HumanoidRootPart
local function getCharacterData()
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
return char, hrp
end
-- Find BasePart in Model or BasePart itself
local function findBasePart(obj)
if obj:IsA("BasePart") then return obj end
if obj:IsA("Model") then
return obj.PrimaryPart or obj:FindFirstChildWhichIsA("BasePart")
end
return nil
end
-- Fire all ProximityPrompts in a box
local function activatePrompts(obj)
for _, p in ipairs(obj:GetDescendants()) do
if p:IsA("ProximityPrompt") then
fireproximityprompt(p)
end
end
end
-- Get safe teleport position slightly in front of the box
local function getSafePosition(part)
local frontDir = part.CFrame.LookVector
local origin = part.Position + Vector3.new(0, part.Size.Y/2 + SAFE_HEIGHT, 0)
local safePos = origin - frontDir * TELEPORT_STEP
local ray = Ray.new(safePos, Vector3.new(0, -20, 0))
local hit, hitPos = workspace:FindPartOnRay(ray)
if hit then
return Vector3.new(safePos.X, hitPos.Y + SAFE_HEIGHT, safePos.Z)
else
return safePos
end
end
-- Blink character over each box in a batch
local function collectAllBoxes()
local char, hrp = getCharacterData()
if not hrp then return end
local boxes = {}
for _, obj in ipairs(BOX_FOLDER:GetDescendants()) do
if obj.Name == BOX_NAME and obj.Parent then
table.insert(boxes, obj)
end
end
-- Sort by distance
table.sort(boxes, function(a,b)
local pa = findBasePart(a)
local pb = findBasePart(b)
if not pa or not pb then return false end
return (hrp.Position - pa.Position).Magnitude < (hrp.Position - pb.Position).Magnitude
end)
-- Teleport character to each box quickly
for _, box in ipairs(boxes) do
local part = findBasePart(box)
if part then
local safePos = getSafePosition(part)
hrp.CFrame = CFrame.new(safePos)
activatePrompts(box)
end
end
end
-- Loop constantly to collect all boxes
task.spawn(function()
while true do
collectAllBoxes()
task.wait(0.05) -- small wait to prevent freeze
end
end)
-- React instantly to new boxes
BOX_FOLDER.DescendantAdded:Connect(function(obj)
if obj.Name == BOX_NAME then
task.wait(0.01)
local char, hrp = getCharacterData()
if hrp then
local part = findBasePart(obj)
if part then
hrp.CFrame = CFrame.new(getSafePosition(part))
activatePrompts(obj)
end
end
end
end)
-- Handle respawn
player.CharacterAdded:Connect(function(char)
local hrp = char:WaitForChild("HumanoidRootPart")
end)
Bro this is nice script! Maybe you can also try prison pump thanks!