<roblox version="4">
  <Item class="ReplicatedStorage" referent="0">
    <Properties>
      <string name="Name">ReplicatedStorage</string>
    </Properties>
  </Item>
  <Item class="ServerScriptService" referent="1">
    <Properties>
      <string name="Name">ServerScriptService</string>
    </Properties>
    <Item class="Script" referent="2">
      <Properties>
        <string name="Name">PortfolioPolish</string>
        <token name="RunContext">0</token>
        <string name="Source"><![CDATA[local Players = game:GetService("Players")
local Lighting = game:GetService("Lighting")

local PROJECTS = {
	AetherDuel = {title = "AETHER DUEL", accent = Color3.fromRGB(67, 167, 255)},
	SkylineSprint = {title = "SKYLINE SPRINT", accent = Color3.fromRGB(45, 200, 255)},
	BomblineGrid = {title = "BOMBLINE GRID", accent = Color3.fromRGB(255, 193, 70)},
	SignalSiege = {title = "SIGNAL SIEGE", accent = Color3.fromRGB(55, 190, 255)},
	BuildAndSaveWorld = {title = "BUILD & SAVE", accent = Color3.fromRGB(255, 208, 84)},
	RailRushWorld = {title = "RAIL RUSH", accent = Color3.fromRGB(104, 205, 255)},
	FreightyardArena = {title = "TEAM SHOTGUN", accent = Color3.fromRGB(255, 133, 73)},
	CrystalFoundry = {title = "CRYSTAL FOUNDRY", accent = Color3.fromRGB(151, 103, 255)},
}

local function findProject()
	for name, config in pairs(PROJECTS) do
		local world = workspace:FindFirstChild(name)
		if world then return world, name, config end
	end
	for _ = 1, 100 do
		task.wait(0.1)
		for name, config in pairs(PROJECTS) do
			local world = workspace:FindFirstChild(name)
			if world then return world, name, config end
		end
	end
end

local world, projectName, config = findProject()
if not world then return end
workspace:SetAttribute("PortfolioProject", projectName)
workspace:SetAttribute("PortfolioTitle", config.title)
workspace:SetAttribute("PortfolioAccent", config.accent)

local polish = Instance.new("Folder")
polish.Name = "PresentationPolish"
polish.Parent = world

local function makePart(name, size, cframe, color, material, parent)
	local part = Instance.new("Part")
	part.Name = name
	part.Size = size
	part.CFrame = cframe
	part.Color = color
	part.Material = material or Enum.Material.SmoothPlastic
	part.Anchored = true
	part.TopSurface = Enum.SurfaceType.Smooth
	part.BottomSurface = Enum.SurfaceType.Smooth
	part.Parent = parent or polish
	return part
end

local function billboard(position, text, accent)
	local anchor = makePart("Landmark", Vector3.new(1, 1, 1), CFrame.new(position), accent, Enum.Material.Neon)
	anchor.Transparency = 1
	anchor.CanCollide = false
	local gui = Instance.new("BillboardGui")
	gui.Size = UDim2.fromOffset(420, 90)
	gui.AlwaysOnTop = false
	gui.MaxDistance = 260
	gui.Parent = anchor
	local label = Instance.new("TextLabel")
	label.Size = UDim2.fromScale(1, 1)
	label.BackgroundTransparency = 1
	label.Text = text
	label.TextColor3 = Color3.new(1, 1, 1)
	label.TextStrokeTransparency = 0.25
	label.Font = Enum.Font.GothamBlack
	label.TextScaled = true
	label.Parent = gui
end

local function barrier(size, position)
	local wall = makePart("SafetyBarrier", size, CFrame.new(position), Color3.new(1, 1, 1), Enum.Material.SmoothPlastic)
	wall.Transparency = 1
	wall.CanCollide = true
	wall.CanQuery = false
end

local function lamp(position, accent)
	makePart("LampPost", Vector3.new(1, 12, 1), CFrame.new(position + Vector3.new(0, 6, 0)), Color3.fromRGB(47, 53, 63), Enum.Material.Metal)
	local head = makePart("LampHead", Vector3.new(3, 1, 3), CFrame.new(position + Vector3.new(0, 12, 0)), accent, Enum.Material.Neon)
	head.CanCollide = false
	local light = Instance.new("PointLight")
	light.Color = accent
	light.Range = 24
	light.Brightness = 1.2
	light.Parent = head
end

local dressers = {}

dressers.AetherDuel = function()
	billboard(Vector3.new(0, 35, -49), "AETHER DUEL", config.accent)
	for _, position in ipairs({Vector3.new(-38, 2, 0), Vector3.new(38, 2, 0), Vector3.new(0, 2, -38), Vector3.new(0, 2, 38)}) do lamp(position, config.accent) end
	barrier(Vector3.new(116, 18, 2), Vector3.new(0, 8, -56)); barrier(Vector3.new(116, 18, 2), Vector3.new(0, 8, 56))
	barrier(Vector3.new(2, 18, 116), Vector3.new(-56, 8, 0)); barrier(Vector3.new(2, 18, 116), Vector3.new(56, 8, 0))
end

dressers.SkylineSprint = function()
	billboard(Vector3.new(0, 34, -150), "SKYLINE SPRINT", config.accent)
	for _, position in ipairs({Vector3.new(-185, 2, -168), Vector3.new(-90, 2, -168), Vector3.new(0, 2, -168), Vector3.new(90, 2, -168), Vector3.new(185, 2, -168)}) do lamp(position, config.accent) end
end

dressers.BomblineGrid = function()
	billboard(Vector3.new(0, 29, -82), "BOMBLINE GRID", config.accent)
	barrier(Vector3.new(170, 12, 2), Vector3.new(0, 5, -83)); barrier(Vector3.new(170, 12, 2), Vector3.new(0, 5, 83))
	barrier(Vector3.new(2, 12, 170), Vector3.new(-83, 5, 0)); barrier(Vector3.new(2, 12, 170), Vector3.new(83, 5, 0))
end

dressers.SignalSiege = function()
	billboard(Vector3.new(155, 39, 18), "PROTECT THE SIGNAL", config.accent)
	for _, position in ipairs({Vector3.new(-170, 1, -140), Vector3.new(-80, 1, 35), Vector3.new(45, 1, 55), Vector3.new(145, 1, 100)}) do lamp(position, config.accent) end
end

dressers.BuildAndSaveWorld = function()
	billboard(Vector3.new(0, 25, 36), "YOUR WORKSHOP", config.accent)
	for _, position in ipairs({Vector3.new(-43, 0, -43), Vector3.new(43, 0, -43), Vector3.new(-43, 0, 43), Vector3.new(43, 0, 43)}) do lamp(position, config.accent) end
end

dressers.RailRushWorld = function()
	billboard(Vector3.new(0, 53, 4), "RAIL RUSH", config.accent)
	for _, position in ipairs({Vector3.new(-18, 32, 8), Vector3.new(18, 32, 8), Vector3.new(-18, 30, -10), Vector3.new(18, 30, -10)}) do lamp(position, config.accent) end
end

dressers.FreightyardArena = function()
	billboard(Vector3.new(0, 29, -61), "FREIGHTYARD SHOWDOWN", config.accent)
	for _, position in ipairs({Vector3.new(-70, 0, -50), Vector3.new(-25, 0, 50), Vector3.new(25, 0, -50), Vector3.new(70, 0, 50)}) do lamp(position, config.accent) end
end

dressers.CrystalFoundry = function()
	billboard(Vector3.new(0, 28, 73), "CRYSTAL FOUNDRY", config.accent)
	for _, position in ipairs({Vector3.new(-32, 0, 35), Vector3.new(32, 0, 35), Vector3.new(-32, 0, 70), Vector3.new(32, 0, 70)}) do lamp(position, config.accent) end
end

if dressers[projectName] then dressers[projectName]() end

local colorCorrection = Instance.new("ColorCorrectionEffect")
colorCorrection.Name = "PortfolioColor"
colorCorrection.Brightness = 0.02
colorCorrection.Contrast = 0.08
colorCorrection.Saturation = 0.06
colorCorrection.Parent = Lighting

local function dressCharacter(character)
	local torso = character:WaitForChild("UpperTorso", 3) or character:WaitForChild("Torso", 3)
	if not torso or character:FindFirstChild("PortfolioArmor") then return end
	local folder = Instance.new("Folder")
	folder.Name = "PortfolioArmor"
	folder.Parent = character
	for _, offset in ipairs({-1, 1}) do
		local plate = Instance.new("Part")
		plate.Name = "ShoulderPlate"
		plate.Size = Vector3.new(1.5, 0.55, 1.8)
		plate.Color = config.accent
		plate.Material = Enum.Material.Metal
		plate.CanCollide = false
		plate.Massless = true
		plate.CFrame = torso.CFrame * CFrame.new(offset * 1.55, 0.75, 0)
		plate.Parent = folder
		local weld = Instance.new("WeldConstraint")
		weld.Part0 = torso
		weld.Part1 = plate
		weld.Parent = plate
	end
end

local function stabilizeCharacter(character)
	local humanoid = character:WaitForChild("Humanoid", 8)
	local root = character:WaitForChild("HumanoidRootPart", 8)
	if not humanoid or not root then return end

	-- Every portfolio map is generated by a server script. On a cold Studio play,
	-- Roblox can create the avatar before that map''s SpawnLocation is ready.
	local spawnLocation = world:FindFirstChildWhichIsA("SpawnLocation", true)
	if spawnLocation then
		root.AssemblyLinearVelocity = Vector3.zero
		root.AssemblyAngularVelocity = Vector3.zero
		root.CFrame = spawnLocation.CFrame * CFrame.new(0, 4, 0)
	end

	local forceField = Instance.new("ForceField")
	forceField.Name = "SpawnProtection"
	forceField.Visible = false
	forceField.Parent = character
	humanoid.Health = humanoid.MaxHealth

	local safeCFrame = root.CFrame
	local started = os.clock()
	local connection
	connection = game:GetService("RunService").Heartbeat:Connect(function()
		if not character.Parent or humanoid.Health <= 0 then
			connection:Disconnect()
			return
		end
		if root.Position.Y < -40 then
			root.AssemblyLinearVelocity = Vector3.zero
			root.AssemblyAngularVelocity = Vector3.zero
			root.CFrame = safeCFrame
			humanoid.Health = humanoid.MaxHealth
		end
		if os.clock() - started >= 8 then
			connection:Disconnect()
			if forceField.Parent then forceField:Destroy() end
		end
	end)
end

local function setupPlayer(player)
	player.CharacterAdded:Connect(function(character)
		task.spawn(stabilizeCharacter, character)
		task.spawn(dressCharacter, character)
	end)
	if player.Character then
		task.spawn(stabilizeCharacter, player.Character)
		task.spawn(dressCharacter, player.Character)
	end
end
Players.PlayerAdded:Connect(setupPlayer)
for _, player in ipairs(Players:GetPlayers()) do setupPlayer(player) end
]]></string>
      </Properties>
    </Item>
    <Item class="Script" referent="3">
      <Properties>
        <string name="Name">RailServer</string>
        <token name="RunContext">0</token>
        <string name="Source"><![CDATA[local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")

local remotes = Instance.new("Folder")
remotes.Name = "RailRemotes"
remotes.Parent = ReplicatedStorage

local inputRemote = Instance.new("RemoteEvent")
inputRemote.Name = "Input"
inputRemote.Parent = remotes

local stateRemote = Instance.new("RemoteEvent")
stateRemote.Name = "State"
stateRemote.Parent = remotes

local world = Instance.new("Folder")
world.Name = "RailRushWorld"
world.Parent = workspace

workspace.FallenPartsDestroyHeight = -120
Lighting.ClockTime = 17.2
Lighting.Brightness = 2.3
Lighting.Ambient = Color3.fromRGB(100, 112, 132)
Lighting.OutdoorAmbient = Color3.fromRGB(129, 141, 159)

local atmosphere = Instance.new("Atmosphere")
atmosphere.Density = 0.3
atmosphere.Color = Color3.fromRGB(213, 227, 255)
atmosphere.Decay = Color3.fromRGB(91, 117, 151)
atmosphere.Parent = Lighting

local bloom = Instance.new("BloomEffect")
bloom.Intensity = 0.25
bloom.Size = 24
bloom.Threshold = 1.7
bloom.Parent = Lighting

local mainPath = {
	Vector3.new(0, 34, 0), Vector3.new(0, 31, -28), Vector3.new(12, 27, -56),
	Vector3.new(30, 22, -84), Vector3.new(30, 18, -116), Vector3.new(12, 14, -146),
}
local leftPath = {
	Vector3.new(12, 14, -146), Vector3.new(-12, 11, -176), Vector3.new(-28, 8, -208),
	Vector3.new(-12, 5, -242), Vector3.new(0, 2, -274),
}
local rightPath = {
	Vector3.new(12, 14, -146), Vector3.new(38, 13, -174), Vector3.new(52, 9, -205),
	Vector3.new(32, 5, -238), Vector3.new(0, 2, -274),
}

local function makePart(name, size, cframe, color, material)
	local part = Instance.new("Part")
	part.Name = name
	part.Size = size
	part.CFrame = cframe
	part.Anchored = true
	part.Material = material or Enum.Material.Metal
	part.Color = color
	part.TopSurface = Enum.SurfaceType.Smooth
	part.BottomSurface = Enum.SurfaceType.Smooth
	part.Parent = world
	return part
end

local function railSegment(a, b, color)
	local midpoint = (a + b) / 2
	local length = (b - a).Magnitude
	local rail = makePart("Rail", Vector3.new(1.2, 1.2, length), CFrame.lookAt(midpoint, b), color, Enum.Material.Metal)
	local glow = Instance.new("PointLight")
	glow.Color = color
	glow.Range = 10
	glow.Brightness = 0.35
	glow.Parent = rail
	return rail
end

local function drawPath(points, color)
	for index = 1, #points - 1 do railSegment(points[index], points[index + 1], color) end
end

drawPath(mainPath, Color3.fromRGB(62, 77, 95))
drawPath(leftPath, Color3.fromRGB(61, 143, 201))
drawPath(rightPath, Color3.fromRGB(238, 153, 57))

for index = 0, 7 do
	local side = index % 2 == 0 and -1 or 1
	local tower = makePart("SkyTower", Vector3.new(20, 45 + index * 2, 20), CFrame.new(side * (72 + index * 8), 5, -30 - index * 36), Color3.fromRGB(39 + index * 3, 47, 65), Enum.Material.Concrete)
	for floor = 1, 6 do
		local window = makePart("Window", Vector3.new(20.2, 1.6, 0.25), tower.CFrame * CFrame.new(0, -tower.Size.Y / 2 + 6 + floor * 5, side > 0 and -10.1 or 10.1), Color3.fromRGB(115, 205, 255), Enum.Material.Neon)
		window.CanCollide = false
	end
end

local startPlatform = makePart("StartPlatform", Vector3.new(24, 2, 24), CFrame.new(mainPath[1] + Vector3.new(0, -2, 8)), Color3.fromRGB(48, 57, 70), Enum.Material.Slate)
local spawn = Instance.new("SpawnLocation")
spawn.Name = "RailSpawn"
spawn.Size = Vector3.new(8, 1, 8)
spawn.Position = startPlatform.Position + Vector3.new(0, 2, 5)
spawn.Anchored = true
spawn.Neutral = true
spawn.Color = Color3.fromRGB(88, 194, 255)
spawn.Material = Enum.Material.Neon
spawn.Parent = world

local startPrompt = Instance.new("ProximityPrompt")
startPrompt.ActionText = "Start Run"
startPrompt.ObjectText = "Skyline Rail"
startPrompt.KeyboardKeyCode = Enum.KeyCode.E
startPrompt.HoldDuration = 0
startPrompt.MaxActivationDistance = 12
startPrompt.Parent = startPlatform

local finish = makePart("FinishGate", Vector3.new(30, 18, 2), CFrame.new(0, 10, -280), Color3.fromRGB(90, 235, 145), Enum.Material.Neon)
finish.CanCollide = false

local hazardPositions = {Vector3.new(30, 20, -101), Vector3.new(-20, 10, -195), Vector3.new(46, 10, -195)}
for _, position in ipairs(hazardPositions) do
	local hazard = makePart("JumpBlocker", Vector3.new(8, 7, 3), CFrame.new(position), Color3.fromRGB(234, 70, 67), Enum.Material.Neon)
	hazard.CanCollide = false
end

local sessions = {}

local function combinedPath(branch)
	local path = table.clone(mainPath)
	local extension = branch == "Right" and rightPath or leftPath
	for index = 2, #extension do table.insert(path, extension[index]) end
	return path
end

local function stopRun(player, completed, crashed)
	local session = sessions[player]
	if not session then return end
	sessions[player] = nil
	local character = player.Character
	local root = character and character:FindFirstChild("HumanoidRootPart")
	local humanoid = character and character:FindFirstChildOfClass("Humanoid")
	if root then root.Anchored = false end
	if humanoid then humanoid.AutoRotate = true end
	if completed then
		local elapsed = os.clock() - session.startedAt
		local best = player:GetAttribute("RailBest")
		if not best or elapsed < best then player:SetAttribute("RailBest", elapsed) end
		player:SetAttribute("RailWins", (player:GetAttribute("RailWins") or 0) + 1)
		stateRemote:FireClient(player, "Finished", elapsed)
	else
		if root then root.CFrame = spawn.CFrame + Vector3.new(0, 4, 0) end
		stateRemote:FireClient(player, crashed and "Crashed" or "Stopped")
	end
end

local function startRun(player)
	if sessions[player] then return end
	local character = player.Character
	local root = character and character:FindFirstChild("HumanoidRootPart")
	local humanoid = character and character:FindFirstChildOfClass("Humanoid")
	if not root or not humanoid or humanoid.Health <= 0 then return end
	root.Anchored = true
	humanoid.AutoRotate = false
	root.CFrame = CFrame.lookAt(mainPath[1] + Vector3.new(0, 3, 0), mainPath[2] + Vector3.new(0, 3, 0))
	sessions[player] = {
		path = combinedPath("Left"), branch = "Left", segment = 1, progress = 0,
		speed = 34, startedAt = os.clock(), jumpingUntil = 0, checkpoint = 1,
	}
	stateRemote:FireClient(player, "Started")
end

startPrompt.Triggered:Connect(startRun)

inputRemote.OnServerEvent:Connect(function(player, action)
	local session = sessions[player]
	if not session then return end
	if action == "Left" or action == "Right" then
		if session.segment <= #mainPath - 1 then
			session.branch = action
			session.path = combinedPath(action)
		end
	elseif action == "Jump" and os.clock() >= session.jumpingUntil then
		session.jumpingUntil = os.clock() + 0.75
	end
end)

RunService.Heartbeat:Connect(function(dt)
	for player, session in pairs(sessions) do
		local character = player.Character
		local root = character and character:FindFirstChild("HumanoidRootPart")
		local humanoid = character and character:FindFirstChildOfClass("Humanoid")
		if not root or not humanoid or humanoid.Health <= 0 then
			stopRun(player, false)
			continue
		end
		local a = session.path[session.segment]
		local b = session.path[session.segment + 1]
		if not a or not b then stopRun(player, true); continue end
		local segmentLength = (b - a).Magnitude
		local slopeBonus = math.clamp((a.Y - b.Y) * 0.7, -5, 12)
		session.speed = math.clamp(session.speed + slopeBonus * dt, 28, 62)
		session.progress += session.speed * dt / segmentLength
		if session.progress >= 1 then
			session.progress -= 1
			session.segment += 1
			session.checkpoint = session.segment
			stateRemote:FireClient(player, "Checkpoint", session.segment, session.branch)
			a = session.path[session.segment]
			b = session.path[session.segment + 1]
			if not a or not b then stopRun(player, true); continue end
		end
		local position = a:Lerp(b, session.progress) + Vector3.new(0, 3, 0)
		local jumpRemaining = session.jumpingUntil - os.clock()
		if jumpRemaining > 0 then
			position += Vector3.new(0, math.sin((0.75 - jumpRemaining) / 0.75 * math.pi) * 9, 0)
		end
		root.CFrame = CFrame.lookAt(position, position + (b - a).Unit)
		if jumpRemaining <= 0 then
			for _, hazardPosition in ipairs(hazardPositions) do
				local flatDistance = (Vector3.new(position.X, 0, position.Z) - Vector3.new(hazardPosition.X, 0, hazardPosition.Z)).Magnitude
				if flatDistance < 6 then
					stopRun(player, false, true)
					break
				end
			end
		end
		if not sessions[player] then continue end
		stateRemote:FireClient(player, "Tick", os.clock() - session.startedAt, session.speed)
	end
end)

Players.PlayerAdded:Connect(function(player)
	player:SetAttribute("RailWins", 0)
end)
Players.PlayerRemoving:Connect(function(player) sessions[player] = nil end)
]]></string>
      </Properties>
    </Item>
  </Item>
  <Item class="StarterPlayer" referent="4">
    <Properties>
      <string name="Name">StarterPlayer</string>
    </Properties>
    <Item class="StarterPlayerScripts" referent="5">
      <Properties>
        <string name="Name">StarterPlayerScripts</string>
      </Properties>
      <Item class="LocalScript" referent="6">
        <Properties>
          <string name="Name">PortfolioPolish</string>
          <string name="Source"><![CDATA[local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local projectName = workspace:GetAttribute("PortfolioProject")
if not projectName then
	workspace:GetAttributeChangedSignal("PortfolioProject"):Wait()
	projectName = workspace:GetAttribute("PortfolioProject")
end

local title = workspace:GetAttribute("PortfolioTitle") or "NAKEL GAMEPLAY DEMO"
local accent = workspace:GetAttribute("PortfolioAccent") or Color3.fromRGB(68, 180, 255)
local instructions = {
	AetherDuel = "CLICK COMBO  •  E HEAVY  •  Q DASH  •  HOLD F BLOCK",
	SkylineSprint = "W/S THROTTLE  •  A/D STEER  •  SHIFT DRIFT  •  SPACE BOOST",
	BomblineGrid = "WATCH WARNING TILES  •  MOVE BEFORE THE BLAST",
	SignalSiege = "CLICK GOLD PADS  •  CLICK TOWERS TO SELECT  •  U UPGRADE",
	BuildAndSaveWorld = "B BUILD MODE  •  1–4 ITEM  •  R ROTATE  •  X DELETE",
	RailRushWorld = "E START  •  A/D CHOOSE ROUTE  •  SPACE JUMP",
	FreightyardArena = "CLICK FIRE  •  R RELOAD  •  USE COVER",
	CrystalFoundry = "CLICK OR E TO HARVEST  •  E AT STATIONS TO UPGRADE",
}

local gui = Instance.new("ScreenGui")
gui.Name = "PortfolioPresentation"
gui.IgnoreGuiInset = true
gui.ResetOnSpawn = false
gui.DisplayOrder = 100
gui.Parent = player:WaitForChild("PlayerGui")

local intro = Instance.new("Frame")
intro.Size = UDim2.fromScale(1, 1)
intro.BackgroundColor3 = Color3.fromRGB(7, 11, 18)
intro.Parent = gui

local line = Instance.new("Frame")
line.AnchorPoint = Vector2.new(0.5, 0.5)
line.Position = UDim2.fromScale(0.5, 0.58)
line.Size = UDim2.fromOffset(0, 3)
line.BackgroundColor3 = accent
line.BorderSizePixel = 0
line.Parent = intro

local heading = Instance.new("TextLabel")
heading.AnchorPoint = Vector2.new(0.5, 0.5)
heading.Position = UDim2.fromScale(0.5, 0.45)
heading.Size = UDim2.new(0.9, 0, 0, 80)
heading.BackgroundTransparency = 1
heading.Text = title
heading.TextColor3 = Color3.new(1, 1, 1)
heading.TextTransparency = 1
heading.Font = Enum.Font.GothamBlack
heading.TextScaled = true
heading.Parent = intro
local sizeConstraint = Instance.new("UITextSizeConstraint")
sizeConstraint.MaxTextSize = 46
sizeConstraint.MinTextSize = 24
sizeConstraint.Parent = heading

local subtitle = Instance.new("TextLabel")
subtitle.AnchorPoint = Vector2.new(0.5, 0.5)
subtitle.Position = UDim2.fromScale(0.5, 0.66)
subtitle.Size = UDim2.new(0.9, 0, 0, 40)
subtitle.BackgroundTransparency = 1
subtitle.Text = instructions[projectName] or "PLAYABLE PORTFOLIO PROTOTYPE"
subtitle.TextColor3 = Color3.fromRGB(188, 202, 219)
subtitle.TextTransparency = 1
subtitle.Font = Enum.Font.GothamBold
subtitle.TextSize = 14
subtitle.TextWrapped = true
subtitle.Parent = intro

TweenService:Create(heading, TweenInfo.new(0.35), {TextTransparency = 0}):Play()
TweenService:Create(line, TweenInfo.new(0.45), {Size = UDim2.new(0.5, 0, 0, 3)}):Play()
TweenService:Create(subtitle, TweenInfo.new(0.4), {TextTransparency = 0}):Play()
task.delay(1.8, function()
	TweenService:Create(intro, TweenInfo.new(0.45), {BackgroundTransparency = 1}):Play()
	TweenService:Create(heading, TweenInfo.new(0.3), {TextTransparency = 1}):Play()
	TweenService:Create(subtitle, TweenInfo.new(0.3), {TextTransparency = 1}):Play()
	TweenService:Create(line, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
	task.wait(0.5)
	intro:Destroy()
end)

if UserInputService.TouchEnabled then
	local touchHint = Instance.new("TextLabel")
	touchHint.AnchorPoint = Vector2.new(0.5, 1)
	touchHint.Position = UDim2.new(0.5, 0, 1, -10)
	touchHint.Size = UDim2.new(0.92, 0, 0, 26)
	touchHint.BackgroundColor3 = Color3.fromRGB(10, 16, 25)
	touchHint.BackgroundTransparency = 0.18
	touchHint.Text = "Desktop controls recommended for this portfolio build"
	touchHint.TextColor3 = Color3.fromRGB(213, 221, 232)
	touchHint.Font = Enum.Font.GothamMedium
	touchHint.TextSize = 11
	touchHint.Parent = gui
	Instance.new("UICorner", touchHint).CornerRadius = UDim.new(0, 8)
end
]]></string>
        </Properties>
      </Item>
      <Item class="LocalScript" referent="7">
        <Properties>
          <string name="Name">RailClient</string>
          <string name="Source"><![CDATA[local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local remotes = ReplicatedStorage:WaitForChild("RailRemotes")
local inputRemote = remotes:WaitForChild("Input")
local stateRemote = remotes:WaitForChild("State")
local running = false

local gui = Instance.new("ScreenGui")
gui.Name = "RailRushHUD"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")

local card = Instance.new("Frame")
card.Size = UDim2.fromOffset(330, 132)
card.Position = UDim2.fromOffset(24, 24)
card.BackgroundColor3 = Color3.fromRGB(17, 24, 36)
card.BackgroundTransparency = 0.08
card.Parent = gui
Instance.new("UICorner", card).CornerRadius = UDim.new(0, 16)

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, -24, 0, 36)
title.Position = UDim2.fromOffset(12, 8)
title.BackgroundTransparency = 1
title.Text = "RAIL RUSH"
title.TextColor3 = Color3.fromRGB(104, 205, 255)
title.Font = Enum.Font.GothamBlack
title.TextSize = 24
title.TextXAlignment = Enum.TextXAlignment.Left
title.Parent = card

local timer = Instance.new("TextLabel")
timer.Size = UDim2.new(0.55, 0, 0, 42)
timer.Position = UDim2.fromOffset(12, 43)
timer.BackgroundTransparency = 1
timer.Text = "00:00.000"
timer.TextColor3 = Color3.new(1, 1, 1)
timer.Font = Enum.Font.RobotoMono
timer.TextSize = 25
timer.TextXAlignment = Enum.TextXAlignment.Left
timer.Parent = card

local speed = Instance.new("TextLabel")
speed.Size = UDim2.new(0.4, -12, 0, 42)
speed.Position = UDim2.new(0.6, 0, 0, 43)
speed.BackgroundTransparency = 1
speed.Text = "0 SPD"
speed.TextColor3 = Color3.fromRGB(255, 185, 82)
speed.Font = Enum.Font.GothamBold
speed.TextSize = 17
speed.TextXAlignment = Enum.TextXAlignment.Right
speed.Parent = card

local help = Instance.new("TextLabel")
help.Size = UDim2.new(1, -24, 0, 34)
help.Position = UDim2.fromOffset(12, 91)
help.BackgroundTransparency = 1
help.Text = "E START  •  A/D ROUTE  •  SPACE JUMP"
help.TextColor3 = Color3.fromRGB(197, 207, 220)
help.Font = Enum.Font.GothamSemibold
help.TextSize = 13
help.TextXAlignment = Enum.TextXAlignment.Left
help.Parent = card

local routeBanner = Instance.new("TextLabel")
routeBanner.Size = UDim2.fromOffset(440, 54)
routeBanner.Position = UDim2.new(0.5, -220, 0.78, 0)
routeBanner.BackgroundColor3 = Color3.fromRGB(18, 28, 43)
routeBanner.BackgroundTransparency = 0.08
routeBanner.Text = "CHOOSE ROUTE:  A BLUE  /  D ORANGE"
routeBanner.TextColor3 = Color3.new(1, 1, 1)
routeBanner.Font = Enum.Font.GothamBlack
routeBanner.TextSize = 18
routeBanner.Visible = false
routeBanner.Parent = gui
Instance.new("UICorner", routeBanner).CornerRadius = UDim.new(0, 14)

local function formatTime(value)
	local minutes = math.floor(value / 60)
	local seconds = value - minutes * 60
	return string.format("%02d:%06.3f", minutes, seconds)
end

UserInputService.InputBegan:Connect(function(input, processed)
	if processed or not running then return end
	if input.KeyCode == Enum.KeyCode.A then
		inputRemote:FireServer("Left")
		routeBanner.Text = "BLUE ROUTE SELECTED"
	elseif input.KeyCode == Enum.KeyCode.D then
		inputRemote:FireServer("Right")
		routeBanner.Text = "ORANGE ROUTE SELECTED"
	elseif input.KeyCode == Enum.KeyCode.Space then
		inputRemote:FireServer("Jump")
	end
end)

stateRemote.OnClientEvent:Connect(function(state, value, extra)
	if state == "Started" then
		running = true
		routeBanner.Visible = true
		routeBanner.Text = "CHOOSE ROUTE:  A BLUE  /  D ORANGE"
		help.Text = "JUMP RED BLOCKERS  •  HOLD YOUR LINE"
	elseif state == "Tick" then
		timer.Text = formatTime(value)
		speed.Text = string.format("%d SPD", math.floor(extra))
	elseif state == "Checkpoint" then
		if value >= 5 then
			routeBanner.Visible = true
			routeBanner.Text = tostring(extra):upper() .. " ROUTE  •  COMMIT!"
			task.delay(2, function() if running then routeBanner.Visible = false end end)
		end
	elseif state == "Finished" then
		running = false
		routeBanner.Visible = true
		routeBanner.Text = "FINISH  •  " .. formatTime(value)
		help.Text = "Return to the start gate to race again"
	elseif state == "Stopped" then
		running = false
		routeBanner.Visible = false
		help.Text = "E START  •  A/D ROUTE  •  SPACE JUMP"
	elseif state == "Crashed" then
		routeBanner.Visible = true
		routeBanner.Text = "CRASHED  •  TIME YOUR JUMP"
	end
end)
]]></string>
        </Properties>
      </Item>
    </Item>
  </Item>
</roblox>