<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">EconomyServer</string>
        <token name="RunContext">0</token>
        <string name="Source"><![CDATA[local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DataStoreService = game:GetService("DataStoreService")
local Lighting = game:GetService("Lighting")

local remotes = Instance.new("Folder")
remotes.Name = "EconomyRemotes"
remotes.Parent = ReplicatedStorage
local harvestRemote = Instance.new("RemoteEvent")
harvestRemote.Name = "Harvest"
harvestRemote.Parent = remotes
local noticeRemote = Instance.new("RemoteEvent")
noticeRemote.Name = "Notice"
noticeRemote.Parent = remotes

local world = Instance.new("Folder")
world.Name = "CrystalFoundry"
world.Parent = workspace
local nodesFolder = Instance.new("Folder")
nodesFolder.Name = "CrystalNodes"
nodesFolder.Parent = world

workspace.FallenPartsDestroyHeight = -60
Lighting.ClockTime = 10.5
Lighting.Brightness = 2.4
Lighting.Ambient = Color3.fromRGB(106, 114, 127)
Lighting.OutdoorAmbient = Color3.fromRGB(135, 145, 158)

local atmosphere = Instance.new("Atmosphere")
atmosphere.Density = 0.25
atmosphere.Color = Color3.fromRGB(207, 226, 255)
atmosphere.Decay = Color3.fromRGB(104, 127, 156)
atmosphere.Parent = Lighting

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

part("Meadow", Vector3.new(180, 2, 160), CFrame.new(0, -1, 0), Color3.fromRGB(83, 139, 79), Enum.Material.Grass)
part("FoundryFloor", Vector3.new(64, 2, 48), CFrame.new(0, 0, 48), Color3.fromRGB(63, 68, 76), Enum.Material.Slate)
local spawn = Instance.new("SpawnLocation")
spawn.Name = "FoundrySpawn"
spawn.Size = Vector3.new(10, 1, 10)
spawn.Position = Vector3.new(0, 2, 55)
spawn.Anchored = true
spawn.Neutral = true
spawn.Material = Enum.Material.Neon
spawn.Color = Color3.fromRGB(83, 190, 255)
spawn.Parent = world

local nodeColors = {Color3.fromRGB(73, 205, 255), Color3.fromRGB(112, 102, 255), Color3.fromRGB(255, 100, 212)}
local nodePositions = {
	Vector3.new(-55, 4, -30), Vector3.new(-28, 4, -45), Vector3.new(0, 4, -38), Vector3.new(31, 4, -46), Vector3.new(57, 4, -27),
	Vector3.new(-62, 4, 4), Vector3.new(-34, 4, -4), Vector3.new(0, 4, -10), Vector3.new(35, 4, -2), Vector3.new(63, 4, 7),
}
for index, position in ipairs(nodePositions) do
	local node = part("CrystalNode", Vector3.new(6, 9, 6), CFrame.new(position) * CFrame.Angles(0, math.rad(index * 31), math.rad(12)), nodeColors[(index - 1) % #nodeColors + 1], Enum.Material.Neon)
	node.Shape = Enum.PartType.Block
	node:SetAttribute("NodeId", index)
	node:SetAttribute("Active", true)
	node.Parent = nodesFolder
	local light = Instance.new("PointLight")
	light.Color = node.Color
	light.Brightness = 1
	light.Range = 14
	light.Parent = node
end

local function station(name, position, color, actionText, objectText)
	local pad = part(name, Vector3.new(18, 1, 14), CFrame.new(position), color, Enum.Material.Neon)
	local prompt = Instance.new("ProximityPrompt")
	prompt.ActionText = actionText
	prompt.ObjectText = objectText
	prompt.KeyboardKeyCode = Enum.KeyCode.E
	prompt.HoldDuration = 0.25
	prompt.MaxActivationDistance = 12
	prompt.Parent = pad
	return pad, prompt
end

local sellPad, sellPrompt = station("SellStation", Vector3.new(-21, 1.5, 44), Color3.fromRGB(73, 225, 126), "Sell Crystals", "Foundry Intake")
local toolPad, toolPrompt = station("ToolUpgrade", Vector3.new(0, 1.5, 44), Color3.fromRGB(255, 191, 70), "Upgrade Tool", "Forge Console")
local bagPad, bagPrompt = station("BagUpgrade", Vector3.new(21, 1.5, 44), Color3.fromRGB(255, 134, 66), "Upgrade Bag", "Storage Console")
local rebirthPad, rebirthPrompt = station("RebirthCore", Vector3.new(0, 1.5, 68), Color3.fromRGB(176, 89, 255), "Rebirth", "Ascension Core")

local store = DataStoreService:GetDataStore("CrystalFoundry_v1")
local sessions = {}
local lastHarvest = {}

local function capacity(data) return 20 + (data.bagLevel - 1) * 20 end
local function toolPower(data) return data.toolLevel end
local function multiplier(data) return 1 + data.rebirths * 0.5 end
local function toolCost(data) return math.floor(75 * (1.75 ^ (data.toolLevel - 1))) end
local function bagCost(data) return math.floor(60 * (1.65 ^ (data.bagLevel - 1))) end
local function rebirthCost(data) return 2500 * (data.rebirths + 1) end

local function sync(player)
	local data = sessions[player]
	if not data then return end
	player:SetAttribute("Crystals", data.crystals)
	player:SetAttribute("Coins", data.coins)
	player:SetAttribute("ToolLevel", data.toolLevel)
	player:SetAttribute("BagLevel", data.bagLevel)
	player:SetAttribute("Capacity", capacity(data))
	player:SetAttribute("Rebirths", data.rebirths)
	player:SetAttribute("Multiplier", multiplier(data))
	player:SetAttribute("ToolCost", toolCost(data))
	player:SetAttribute("BagCost", bagCost(data))
	player:SetAttribute("RebirthCost", rebirthCost(data))
end

local function save(player)
	local data = sessions[player]
	if not data then return end
	local payload = {coins = data.coins, toolLevel = data.toolLevel, bagLevel = data.bagLevel, rebirths = data.rebirths}
	local ok, err = pcall(function() store:SetAsync("u_" .. player.UserId, payload) end)
	if not ok then warn("Economy save unavailable:", err) end
end

Players.PlayerAdded:Connect(function(player)
	local data = {crystals = 0, coins = 0, toolLevel = 1, bagLevel = 1, rebirths = 0}
	local saved
	local ok, err = pcall(function() saved = store:GetAsync("u_" .. player.UserId) end)
	if ok and type(saved) == "table" then
		data.coins = math.max(0, tonumber(saved.coins) or 0)
		data.toolLevel = math.clamp(math.floor(tonumber(saved.toolLevel) or 1), 1, 50)
		data.bagLevel = math.clamp(math.floor(tonumber(saved.bagLevel) or 1), 1, 50)
		data.rebirths = math.clamp(math.floor(tonumber(saved.rebirths) or 0), 0, 100)
	elseif not ok then warn("Economy load unavailable:", err) end
	sessions[player] = data
	sync(player)
end)

local function harvest(player, node)
	local data = sessions[player]
	local character = player.Character
	local root = character and character:FindFirstChild("HumanoidRootPart")
	if not data or not root or typeof(node) ~= "Instance" or node.Parent ~= nodesFolder or node:GetAttribute("Active") ~= true then return end
	if (root.Position - node.Position).Magnitude > 18 then return end
	if os.clock() - (lastHarvest[player] or 0) < 0.35 then return end
	lastHarvest[player] = os.clock()
	if data.crystals >= capacity(data) then noticeRemote:FireClient(player, "Backpack full — sell at the green pad", "Warning"); return end
	local gained = math.min(toolPower(data), capacity(data) - data.crystals)
	data.crystals += gained
	node:SetAttribute("Active", false)
	node.Transparency = 0.75
	node.CanQuery = false
	sync(player)
	noticeRemote:FireClient(player, "+" .. gained .. " crystals", "Harvest")
	task.delay(1.4, function()
		if node.Parent then node.Transparency = 0; node.CanQuery = true; node:SetAttribute("Active", true) end
	end)
end

harvestRemote.OnServerEvent:Connect(harvest)
for _, node in ipairs(nodesFolder:GetChildren()) do
	local prompt = Instance.new("ProximityPrompt")
	prompt.ActionText = "Harvest"
	prompt.ObjectText = "Crystal Cluster"
	prompt.KeyboardKeyCode = Enum.KeyCode.E
	prompt.HoldDuration = 0.1
	prompt.MaxActivationDistance = 14
	prompt.RequiresLineOfSight = false
	prompt.Parent = node
	prompt.Triggered:Connect(function(player) harvest(player, node) end)
end

sellPrompt.Triggered:Connect(function(player)
	local data = sessions[player]
	if not data or data.crystals <= 0 then noticeRemote:FireClient(player, "Your backpack is empty", "Warning"); return end
	local earned = math.floor(data.crystals * 4 * multiplier(data))
	data.crystals = 0
	data.coins += earned
	sync(player)
	noticeRemote:FireClient(player, "+" .. earned .. " coins", "Sale")
end)

toolPrompt.Triggered:Connect(function(player)
	local data = sessions[player]
	if not data then return end
	local cost = toolCost(data)
	if data.coins < cost then noticeRemote:FireClient(player, "Need " .. cost .. " coins", "Warning"); return end
	data.coins -= cost; data.toolLevel += 1; sync(player)
	noticeRemote:FireClient(player, "Tool upgraded to level " .. data.toolLevel, "Upgrade")
end)

bagPrompt.Triggered:Connect(function(player)
	local data = sessions[player]
	if not data then return end
	local cost = bagCost(data)
	if data.coins < cost then noticeRemote:FireClient(player, "Need " .. cost .. " coins", "Warning"); return end
	data.coins -= cost; data.bagLevel += 1; sync(player)
	noticeRemote:FireClient(player, "Capacity increased to " .. capacity(data), "Upgrade")
end)

rebirthPrompt.Triggered:Connect(function(player)
	local data = sessions[player]
	if not data then return end
	local cost = rebirthCost(data)
	if data.coins < cost then noticeRemote:FireClient(player, "Need " .. cost .. " coins to rebirth", "Warning"); return end
	data.coins = 0; data.crystals = 0; data.toolLevel = 1; data.bagLevel = 1; data.rebirths += 1; sync(player)
	noticeRemote:FireClient(player, "REBIRTH! Permanent multiplier increased", "Rebirth")
end)

Players.PlayerRemoving:Connect(function(player) save(player); sessions[player] = nil; lastHarvest[player] = nil end)
game:BindToClose(function() for _, player in ipairs(Players:GetPlayers()) do save(player) end end)
]]></string>
      </Properties>
    </Item>
    <Item class="Script" referent="3">
      <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>
  <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">EconomyClient</string>
          <string name="Source"><![CDATA[local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

local player = Players.LocalPlayer
local mouse = player:GetMouse()
local remotes = ReplicatedStorage:WaitForChild("EconomyRemotes")
local harvestRemote = remotes:WaitForChild("Harvest")
local noticeRemote = remotes:WaitForChild("Notice")

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

local card = Instance.new("Frame")
card.Size = UDim2.fromOffset(330, 188)
card.Position = UDim2.fromOffset(22, 22)
card.BackgroundColor3 = Color3.fromRGB(22, 28, 39)
card.BackgroundTransparency = 0.06
card.Parent = gui
Instance.new("UICorner", card).CornerRadius = UDim.new(0, 18)

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, -24, 0, 38)
title.Position = UDim2.fromOffset(12, 8)
title.BackgroundTransparency = 1
title.Text = "CRYSTAL FOUNDRY"
title.TextColor3 = Color3.fromRGB(102, 211, 255)
title.Font = Enum.Font.GothamBlack
title.TextSize = 22
title.TextXAlignment = Enum.TextXAlignment.Left
title.Parent = card

local stats = Instance.new("TextLabel")
stats.Size = UDim2.new(1, -24, 0, 92)
stats.Position = UDim2.fromOffset(12, 48)
stats.BackgroundTransparency = 1
stats.TextColor3 = Color3.fromRGB(235, 239, 245)
stats.Font = Enum.Font.GothamSemibold
stats.TextSize = 17
stats.TextXAlignment = Enum.TextXAlignment.Left
stats.TextYAlignment = Enum.TextYAlignment.Top
stats.Parent = card

local tip = Instance.new("TextLabel")
tip.Size = UDim2.new(1, -24, 0, 34)
tip.Position = UDim2.fromOffset(12, 145)
tip.BackgroundTransparency = 1
tip.Text = "CLICK CRYSTALS  •  E AT STATIONS"
tip.TextColor3 = Color3.fromRGB(179, 190, 205)
tip.Font = Enum.Font.Gotham
tip.TextSize = 13
tip.TextXAlignment = Enum.TextXAlignment.Left
tip.Parent = card

local toast = Instance.new("TextLabel")
toast.Size = UDim2.fromOffset(420, 56)
toast.Position = UDim2.new(0.5, -210, 0.78, 0)
toast.BackgroundColor3 = Color3.fromRGB(18, 25, 35)
toast.BackgroundTransparency = 1
toast.TextTransparency = 1
toast.TextColor3 = Color3.new(1, 1, 1)
toast.Font = Enum.Font.GothamBlack
toast.TextSize = 18
toast.Parent = gui
Instance.new("UICorner", toast).CornerRadius = UDim.new(0, 14)

local function refresh()
	stats.Text = string.format("◈ CRYSTALS   %d / %d\n$ COINS       %d\n⚒ TOOL        LV.%d\n↻ REBIRTHS    %d  •  x%.1f", player:GetAttribute("Crystals") or 0, player:GetAttribute("Capacity") or 20, player:GetAttribute("Coins") or 0, player:GetAttribute("ToolLevel") or 1, player:GetAttribute("Rebirths") or 0, player:GetAttribute("Multiplier") or 1)
end
for _, attribute in ipairs({"Crystals", "Capacity", "Coins", "ToolLevel", "Rebirths", "Multiplier"}) do
	player:GetAttributeChangedSignal(attribute):Connect(refresh)
end
refresh()

mouse.Button1Down:Connect(function()
	local target = mouse.Target
	if target and target.Name == "CrystalNode" then harvestRemote:FireServer(target) end
end)

local toastVersion = 0
noticeRemote.OnClientEvent:Connect(function(message, kind)
	toastVersion += 1
	local version = toastVersion
	toast.Text = tostring(message)
	toast.TextColor3 = kind == "Warning" and Color3.fromRGB(255, 124, 100) or kind == "Rebirth" and Color3.fromRGB(210, 132, 255) or Color3.fromRGB(113, 235, 161)
	TweenService:Create(toast, TweenInfo.new(0.16), {BackgroundTransparency = 0.08, TextTransparency = 0}):Play()
	task.delay(1.8, function()
		if toastVersion ~= version then return end
		TweenService:Create(toast, TweenInfo.new(0.25), {BackgroundTransparency = 1, TextTransparency = 1}):Play()
	end)
end)
]]></string>
        </Properties>
      </Item>
      <Item class="LocalScript" referent="7">
        <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>
  </Item>
</roblox>