-- The crux of the user's request: does the ramp run PARALLEL to the highway -- (travelling far along it while climbing), or does it dive off the side? -- Measures longitudinal progress (in mainline samples) vs vertical drop vs -- lateral drift, plus the actual grade. Also finds what the ramp passes over. local ws = game:GetService("Workspace") local RS = game:GetService("ReplicatedStorage") local Circuit = require(RS:WaitForChild("Shared"):WaitForChild("Circuit")) local samples = Circuit.samples local map = ws:FindFirstChild("Map") if not map then return "NOMAP" end local out = {} local function say(s) table.insert(out, s) end local ramps = {} for _, d in ipairs(map:GetDescendants()) do if d:IsA("BasePart") then local name, idx = d.Name:match("^(PA%a+Slip)_Deck_(%d+)$") if name then ramps[name] = ramps[name] or {} table.insert(ramps[name], { i = tonumber(idx), p = d }) end end end local function nearestSample(p) local bd, bi = math.huge, -1 for i = 1, #samples do local s = samples[i] local dd = (Vector3.new(p.X, 0, p.Z) - Vector3.new(s.pos.X, 0, s.pos.Z)).Magnitude if dd < bd then bd, bi = dd, i end end return bi, bd end for _, name in ipairs({ "PAWestSlip", "PAEastSlip" }) do local segs = ramps[name] if not segs then say(name .. ": MISSING") continue end table.sort(segs, function(x, y) return x.i < y.i end) local first, last = segs[1].p, segs[#segs].p local si = nearestSample(first.Position) local ei = nearestSample(last.Position) -- 3D path length along the ramp centreline. local plen = 0 for k = 2, #segs do plen += (segs[k].p.Position - segs[k - 1].p.Position).Magnitude end local drop = first.Position.Y - last.Position.Y local flat = (Vector3.new(first.Position.X, 0, first.Position.Z) - Vector3.new(last.Position.X, 0, last.Position.Z)).Magnitude -- Sample spacing, to convert sample counts into studs. local spacing = (samples[2].pos - samples[1].pos).Magnitude local dsamples = math.abs(ei - si) say(("=== %s ==="):format(name)) say((" segments: %d, seg length ~%.0f studs, path length %.0f studs") :format(#segs, plen / math.max(1, #segs - 1), plen)) say((" mouth at sample %d -> end near sample %d (travels %d samples = %.0f studs ALONG the highway)") :format(si, ei, dsamples, dsamples * spacing)) say((" vertical drop: %.1f studs horizontal run: %.0f studs grade: %.1f%%") :format(drop, flat, 100 * drop / math.max(1, flat))) say((" PARALLEL-ness: %.0f studs along-highway per %.0f studs of drop -> %s") :format(dsamples * spacing, drop, (dsamples * spacing) > drop * 4 and "runs alongside" or "DIVES OFF THE SIDE")) end -- What is underneath the ramp mid-span? (is it over water/air, or over the lot?) local names = {} for _, d in ipairs(ws:GetDescendants()) do if d:IsA("BasePart") then names[d.Name:gsub("_%d+$", "")] = true end end local cats = {} for k in pairs(names) do table.insert(cats, k) end table.sort(cats) say("part categories in world: " .. #cats) say(" " .. table.concat(cats, ", "):sub(1, 900)) return table.concat(out, "\n")