W.I.P untitled drift game lag reduction

Código do script
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LOCAL_PLAYER = Players.LocalPlayer
local LOCAL_CAR_NAME = LOCAL_PLAYER.Name .. "sCar"
local HIDE_DISTANCE = 100
local UPDATE_RATE = 0.25 -- seconds
type CarData = {
Model: Model,
Parts: {BasePart},
Hidden: boolean,
}
local trackedCars: {[Model]: CarData} = {}
local function getRoot(model: Model): BasePart?
return model.PrimaryPart
or model:FindFirstChild("HumanoidRootPart", true)
or model:FindFirstChildWhichIsA("BasePart", true)
end
local function collectRenderableParts(container: Instance, output: {BasePart})
for _, obj in ipairs(container:GetDescendants()) do
if obj:IsA("BasePart") then
table.insert(output, obj)
end
end
end
local function scanCar(car: Model)
if trackedCars[car] then
return
end
if car.Name == LOCAL_CAR_NAME then
return
end
if not car.Name:match("sCar$") then
return
end
local renderParts = {}
local targetContainers = {
"Paint",
"Misc",
"shirtstuckedin",
"c55ag9i",
"jokus13ag9i",
"3037ag9i",
"s14icy",
"jzx81ag9i",
"jee46",
"Model",
"fd3s",
"c33",
"joo o",
}
for _, name in ipairs(targetContainers) do
local container = car:FindFirstChild(name, true)
if container then
collectRenderableParts(container, renderParts)
end
end
trackedCars[car] = {
Model = car,
Parts = renderParts,
Hidden = false,
}
end
local function removeCar(car: Model)
trackedCars[car] = nil
end
local function hideCar(data: CarData)
if data.Hidden then
return
end
data.Hidden = true
for _, part in ipairs(data.Parts) do
if part.Parent then
part.LocalTransparencyModifier = 1
end
end
end
local function showCar(data: CarData)
if not data.Hidden then
return
end
data.Hidden = false
for _, part in ipairs(data.Parts) do
if part.Parent then
part.LocalTransparencyModifier = 0
end
end
end
for _, obj in ipairs(workspace:GetDescendants()) do
if obj:IsA("Model") then
scanCar(obj)
end
end
workspace.DescendantAdded:Connect(function(obj)
if obj:IsA("Model") then
scanCar(obj)
end
end)
workspace.DescendantRemoving:Connect(function(obj)
if obj:IsA("Model") then
removeCar(obj)
end
end)
local accumulator = 0
RunService.Heartbeat:Connect(function(dt)
accumulator += dt
if accumulator < UPDATE_RATE then
return
end
accumulator = 0
local character = LOCAL_PLAYER.Character
if not character then
return
end
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then
return
end
local playerPos = hrp.Position
for model, data in pairs(trackedCars) do
if not model.Parent then
trackedCars[model] = nil
continue
end
local root = getRoot(model)
if not root then
continue
end
local dist = (root.Position - playerPos).Magnitude
if dist >= HIDE_DISTANCE then
hideCar(data)
else
showCar(data)
end
end
end)Descrição
Gets other players cars, gets their paint and interior (still working on getting the interior layers) and makes them transparent based on distance. planning on adding more models to be affected, and planning on having it adjust particles and decals for the skid marks and wheel smoke
Comentários (0)
Entre para participar da conversa
- Seja o primeiro a comentar.
Perguntas frequentes
- Como uso o script W.I.P untitled drift game lag reduction?
- Copie o código acima, abra seu executor de Roblox, cole o código e pressione executar enquanto estiver no jogo. As funcionalidades são ativadas instantaneamente assim que o script é executado.
- O script W.I.P untitled drift game lag reduction é gratuito?
- Sim. Este script é gratuito para copiar e usar. Se ele usa um sistema de chaves, siga o link "Obter chave" para desbloqueá-lo sem custo.
- É seguro usar o script W.I.P untitled drift game lag reduction?
- O código-fonte completo é exibido nesta página para que você possa ler exatamente o que ele faz antes de executá-lo. Sempre use um executor confiável, e lembre-se de que usar scripts é contra os termos de serviço do Roblox — use por sua conta e risco.
- Qual executor funciona com W.I.P untitled drift game lag reduction?
- Este script funciona com a maioria dos executores populares do Roblox. Consulte nossa página de executores para encontrar um executor gratuito ou pago confiável para seu dispositivo.