콘텐츠로 건너뛰기
작동 중

W.I.P untitled drift game lag reduction

CLclarkdevlinorg1 조회수Universal2026년 7월 26일
공유
W.I.P untitled drift game lag reduction

스크립트 코드

Lua
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)

설명

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

댓글 (0)

대화에 참여하려면 로그인하세요

  • 첫 댓글을 작성하세요.

자주 묻는 질문

W.I.P untitled drift game lag reduction 스크립트는 어떻게 사용하나요?
위의 스크립트 코드를 복사하고, Roblox 엑시큐터를 열어 붙여넣은 후, 게임 중에 실행을 누르세요. 스크립트가 실행되면 기능이 즉시 활성화됩니다.
W.I.P untitled drift game lag reduction 스크립트는 무료인가요?
네. 이 스크립트는 무료로 복사하고 사용할 수 있습니다. 키 시스템을 사용하는 경우, 링크를 통해 무료로 키를 받으세요.
W.I.P untitled drift game lag reduction 스크립트는 안전한가요?
전체 소스 코드가 이 페이지에 표시되어 실행 전에 정확히 무엇을 하는지 확인할 수 있습니다. 항상 신뢰할 수 있는 엑시큐터를 사용하고, 스크립트 사용은 Roblox 이용 약관에 위반되므로 자의적 위험으로 사용하세요.
W.I.P untitled drift game lag reduction에 호환되는 엑시큐터는?
이 스크립트는 대부분의 인기 Roblox 엑시큐터에서 작동합니다. 기기에 맞는 신뢰할 수 있는 무료 또는 유료 엑시큐터를 찾으려면 엑시큐터 페이지를 확인하세요.
W.I.P untitled drift game lag reduction | BloxScripter