
KeylessUniversal
local Pl = game:GetService("Players")
local Rs = game:GetService("RunService")
local pl = Pl.LocalPlayer
local ig = false
local cp = {}
local function iG(pt)
local nm = pt.Name:lower()
if nm == "baseplate" or nm == "terrain" or nm == "ground" or
nm == "floor" or nm == "base" or nm == "road" or
nm == "street" or nm == "path" or nm == "grass" then
return true
end
if pt.Size.Y <= 5 and pt.Position.Y < 10 then
return true
end
if pt:IsA("Terrain") then
return true
end
return false
end
local function iP(pt)
for _, p in pairs(Pl:GetPlayers()) do
if p.Character and pt:IsDescendantOf(p.Character) then
return true
end
end
return false
end
local function eG()
if ig then return end
ig = true
cp = {}
for _, pt in pairs(workspace:GetDescendants()) do
if pt:IsA("BasePart") and not iP(pt) and not iG(pt) then
if pt.CanCollide then
cp[pt] = true
pt.CanCollide = false
end
end
end
end
local function dG()
if not ig then return end
ig = false
for pt, _ in pairs(cp) do
if pt and pt.Parent then
pt.CanCollide = true
end
end
cp = {}
end
local function iM()
local ch = pl.Character
if not ch then return false end
local hu = ch:FindFirstChildOfClass("Humanoid")
if hu and (hu.Sit or hu.SeatPart) then
return true
end
local rt = ch:FindFirstChild("HumanoidRootPart")
if rt then
for _, we in pairs(rt:GetChildren()) do
if we:IsA("Weld") or we:IsA("WeldConstraint") or we:IsA("Motor6D") then
local ot = we.Part0 == rt and we.Part1 or we.Part0
if ot and not ot:IsDescendantOf(ch) then
return true
end
end
end
end
return false
end
local ls = false
Rs.Heartbeat:Connect(function()
local mt = iM()
if mt and not ls then
eG()
ls = true
elseif not mt and ls then
dG()
ls = false
end
end)
pl.CharacterAdded:Connect(function()
ig = false
ls = false
cp = {}
end)No comments yet for this script.



