
Keyless

-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ProximityPromptService = game:GetService("ProximityPromptService")
-- Player
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local spawnedItemsFolder = workspace.Map.Functional.SpawnedItems
-- Noclip
local noclipEnabled = false
local teleportedToFallback = false
RunService.Stepped:Connect(function()
if noclipEnabled and character and character:FindFirstChild("Humanoid") then
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") and part.CanCollide then
part.CanCollide = false
end
end
end
end)
-- Force pickup
local function findPrompt(item)
return item:FindFirstChildWhichIsA("ProximityPrompt", true)
end
local function forcePickup(item)
local prompt = findPrompt(item)
if prompt then
task.spawn(function()
for i = 1, 8 do
if not item.Parent then break end
fireproximityprompt(prompt)
task.wait(0.05)
end
end)
end
end
-- Get all items
local function getAllItems()
local items = {}
for _, item in ipairs(spawnedItemsFolder:GetChildren()) do
if item:IsA("Model") or item:IsA("BasePart") then
table.insert(items, item)
end
end
table.sort(items, function(a, b)
local posA = (a:IsA("Model") and a.PrimaryPart and a.PrimaryPart.Position) or (a:IsA("BasePart") and a.Position) or Vector3.new()
local posB = (b:IsA("Model") and b.PrimaryPart and b.PrimaryPart.Position) or (b:IsA("BasePart") and b.Position) or Vector3.new()
return (hrp.Position - posA).Magnitude < (hrp.Position - posB).Magnitude
end)
return items
end
-- Map-specific safe fallback positions
local mapSafePositions = {
Mansion = Vector3.new(-7, 11, 160),
Suburban = Vector3.new(-313, 12, 114),
Villa = Vector3.new(-100, 15, 200), -- adjust to a solid ground location
}
-- Determine current map
local function getCurrentMap()
if workspace:FindFirstChild("Mansion") then
return "Mansion"
elseif workspace:FindFirstChild("Suburban") then
return "Suburban"
elseif workspace:FindFirstChild("Villa") then
return "Villa"
else
return nil
end
end
-- Create or reposition the personal safe block
local safeBlock = workspace:FindFirstChild("SafeFallbackBlock")
if not safeBlock then
safeBlock = Instance.new("Part")
safeBlock.Size = Vector3.new(10, 1, 10)
safeBlock.Anchored = true
safeBlock.CanCollide = true
safeBlock.Transparency = 1
safeBlock.Name = "SafeFallbackBlock"
safeBlock.Parent = workspace
end
local function updateSafeBlockPosition()
local currentMap = getCurrentMap()
local safePos = (currentMap and mapSafePositions[currentMap]) or Vector3.new(0,50,0)
safeBlock.Position = safePos
end
-- Main loop
while true do
if not character or not character.Parent then
character = player.Character or player.CharacterAdded:Wait()
hrp = character:WaitForChild("HumanoidRootPart")
end
updateSafeBlockPosition()
local items = getAllItems()
if #items > 0 then
noclipEnabled = true
teleportedToFallback = false
for _, item in ipairs(items) do
if item and item.Parent then
local pos
if item:IsA("Model") and item.PrimaryPart then
pos = item.PrimaryPart.Position
elseif item:IsA("BasePart") then
pos = item.Position
end
if pos then
hrp.CFrame = CFrame.new(pos + Vector3.new(0, 3, 0))
task.wait(0.05)
forcePickup(item)
end
end
end
noclipEnabled = false
else
if not teleportedToFallback then
hrp.CFrame = safeBlock.CFrame + Vector3.new(0, 3, 0)
teleportedToFallback = true
end
task.wait(0.5)
end
end
fignya