<roblox version="4">
  <Item class="ReplicatedStorage" referent="0">
    <Properties>
      <string name="Name">ReplicatedStorage</string>
    </Properties>
    <Item class="Folder" referent="1">
      <Properties>
        <string name="Name">Shared</string>
      </Properties>
      <Item class="ModuleScript" referent="2">
        <Properties>
          <string name="Name">Config</string>
          <string name="Source"><![CDATA[return {
	CourseName = "TREASURE RUN",
	CheckpointCount = 6,
	DataStoreName = "NeonHeist_v1",
	IntermissionSeconds = 12,
	RoundSeconds = 150,
	LootRespawnSeconds = 7,
	Colors = {
		Panel = Color3.fromRGB(39, 48, 60),
		Primary = Color3.fromRGB(244, 157, 72),
		Accent = Color3.fromRGB(72, 137, 190),
		Danger = Color3.fromRGB(201, 67, 62),
		Text = Color3.fromRGB(255, 250, 238),
		Muted = Color3.fromRGB(196, 205, 211),
	},
}
]]></string>
        </Properties>
      </Item>
    </Item>
  </Item>
  <Item class="ServerScriptService" referent="3">
    <Properties>
      <string name="Name">ServerScriptService</string>
    </Properties>
    <Item class="Script" referent="4">
      <Properties>
        <string name="Name">TitanServer</string>
        <token name="RunContext">0</token>
        <string name="Source"><![CDATA[local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Debris = game:GetService("Debris")
local Lighting = game:GetService("Lighting")

local old = workspace:FindFirstChild("NeonHeistArena")
if old then old:Destroy() end
old = workspace:FindFirstChild("TitanArena")
if old then old:Destroy() end

local arena = Instance.new("Folder")
arena.Name, arena.Parent = "TitanArena", workspace
Lighting.ClockTime, Lighting.Brightness = 16.4, 2.4
Lighting.Ambient, Lighting.OutdoorAmbient = Color3.fromRGB(90, 102, 128), Color3.fromRGB(150, 164, 184)
Lighting.EnvironmentDiffuseScale, Lighting.EnvironmentSpecularScale, Lighting.ShadowSoftness = .55, .8, .28
for _, effect in Lighting:GetChildren() do if effect:GetAttribute("TitanVisual") then effect:Destroy() end end
local atmosphere = Instance.new("Atmosphere"); atmosphere:SetAttribute("TitanVisual", true)
atmosphere.Density, atmosphere.Offset, atmosphere.Haze, atmosphere.Glare = .19, .06, 1.3, .16
atmosphere.Color, atmosphere.Decay, atmosphere.Parent = Color3.fromRGB(185, 214, 238), Color3.fromRGB(86, 105, 137), Lighting
local colorCorrection = Instance.new("ColorCorrectionEffect"); colorCorrection:SetAttribute("TitanVisual", true)
colorCorrection.Contrast, colorCorrection.Saturation, colorCorrection.TintColor, colorCorrection.Parent = .13, .08, Color3.fromRGB(244, 246, 255), Lighting
local sun = Instance.new("SunRaysEffect"); sun:SetAttribute("TitanVisual", true); sun.Intensity, sun.Spread, sun.Parent = .035, .8, Lighting
local bloom = Instance.new("BloomEffect"); bloom:SetAttribute("TitanVisual", true); bloom.Intensity, bloom.Size, bloom.Threshold, bloom.Parent = .18, 24, 1.35, Lighting
local dof = Instance.new("DepthOfFieldEffect"); dof:SetAttribute("TitanVisual", true); dof.FarIntensity, dof.FocusDistance, dof.InFocusRadius, dof.NearIntensity, dof.Parent = .06, 85, 65, 0, Lighting
local function make(name, size, position, color, material)
	local p = Instance.new("Part")
	p.Name, p.Size, p.Position, p.Color = name, size, position, color
	p.Anchored, p.Material, p.TopSurface, p.BottomSurface, p.Parent = true, material or Enum.Material.Concrete, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, arena
	return p
end
local rng = Random.new(426)
make("Foundation", Vector3.new(460, 5, 370), Vector3.new(0, -3, 0), Color3.fromRGB(42, 47, 55), Enum.Material.Concrete)
local roadColor, curbColor = Color3.fromRGB(31, 35, 43), Color3.fromRGB(182, 188, 193)
local roadXs, roadZs = {-132, -44, 44, 132}, {-105, 0, 105}
for _, x in roadXs do
	make("NorthSouthRoad", Vector3.new(30, .45, 360), Vector3.new(x, -.05, 0), roadColor, Enum.Material.Asphalt)
	for z = -160, 160, 16 do local dash = make("LaneDash", Vector3.new(.45, .08, 7), Vector3.new(x, .22, z), Color3.fromRGB(242, 224, 154), Enum.Material.SmoothPlastic); dash.CanCollide = false end
end
for _, z in roadZs do
	make("EastWestRoad", Vector3.new(450, .45, 30), Vector3.new(0, 0, z), roadColor, Enum.Material.Asphalt)
	for x = -210, 210, 16 do local dash = make("LaneDash", Vector3.new(7, .08, .45), Vector3.new(x, .22, z), Color3.fromRGB(242, 224, 154), Enum.Material.SmoothPlastic); dash.CanCollide = false end
end
local facades = {Color3.fromRGB(45,93,112),Color3.fromRGB(109,58,91),Color3.fromRGB(157,83,55),Color3.fromRGB(53,105,71),Color3.fromRGB(62,74,126),Color3.fromRGB(149,115,64)}
local glows = {Color3.fromRGB(136,218,255),Color3.fromRGB(255,181,224),Color3.fromRGB(255,231,159)}
local names = {"BYTE CAFE", "TITAN MART", "METRO LAB", "NOVA ARCADE"}
local function sign(position, text, color)
	local board = make("ShopSign", Vector3.new(12,3.8,.45), position, Color3.fromRGB(24,27,35), Enum.Material.Metal)
	local gui = Instance.new("SurfaceGui"); gui.Face, gui.LightInfluence, gui.Parent = Enum.NormalId.Front, .15, board
	local label = Instance.new("TextLabel"); label.Size, label.BackgroundTransparency, label.Text, label.Font = UDim2.fromScale(1,1), 1, text, Enum.Font.GothamBlack
	label.TextColor3, label.TextScaled, label.TextStrokeTransparency, label.Parent = color, true, .35, gui
end
local function building(cx, cz, sx, sz, floors, color)
	local h = floors * 7 + 5
	make("DetailedBuilding", Vector3.new(sx,h,sz), Vector3.new(cx,h/2+.5,cz), color, Enum.Material.Brick)
	make("RooftopTrim", Vector3.new(sx+1,1.2,sz+1), Vector3.new(cx,h+1,cz), Color3.fromRGB(38,43,53), Enum.Material.Metal)
	make("RooftopUnit", Vector3.new(5,2.5,4), Vector3.new(cx+sx*.2,h+2.3,cz), Color3.fromRGB(83,91,101), Enum.Material.Metal)
	local front = cz-sz/2-.12
	for floor = 1, floors do for wx = -sx/2+3.2, sx/2-2.5, 5.8 do
		local lit = rng:NextNumber() > .28
		local window = make("LitWindow", Vector3.new(3.4,3.6,.24), Vector3.new(cx+wx,floor*7-1.5,front), lit and glows[rng:NextInteger(1,#glows)] or Color3.fromRGB(28,36,50), lit and Enum.Material.Glass or Enum.Material.SmoothPlastic)
		window.CanCollide = false; if lit then window.Transparency = .16 end
	end end
	local storefront = make("Storefront", Vector3.new(sx-4,4.7,.35), Vector3.new(cx,2.7,front-.12), Color3.fromRGB(105,183,205), Enum.Material.Glass); storefront.Transparency = .18
	sign(Vector3.new(cx,6.1,front-.45), names[rng:NextInteger(1,#names)], glows[rng:NextInteger(1,#glows)])
end
local blocks = {{-88,-55,42,58},{0,-55,46,58},{88,-55,42,58},{-88,55,42,58},{0,55,46,58},{88,55,42,58},{-176,-55,48,58},{176,-55,48,58},{-176,55,48,58},{176,55,48,58},{-88,145,42,42},{0,145,46,42},{88,145,42,42}}
for index, b in blocks do
	make("Sidewalk", Vector3.new(b[3]+10,.7,b[4]+10), Vector3.new(b[1],.15,b[2]), curbColor, Enum.Material.Concrete)
	building(b[1],b[2],b[3],b[4],rng:NextInteger(4,9),facades[(index-1)%#facades+1])
end
-- Fire escapes and elevated alley walks create layered routes like the reference district.
for _, base in {{-61,-55},{61,55},{-149,55},{149,-55}} do
	for step = 0, 7 do
		make("FireEscapeStep", Vector3.new(8,.45,2.2), Vector3.new(base[1],1.2+step*1.35,base[2]+step*1.55), Color3.fromRGB(61,68,77), Enum.Material.DiamondPlate)
	end
	local landing = make("FireEscapeLanding", Vector3.new(10,.55,7), Vector3.new(base[1],11.5,base[2]+13), Color3.fromRGB(55,62,70), Enum.Material.DiamondPlate)
	landing.CastShadow = true
end
for _, x in roadXs do for _, z in roadZs do
	for stripe = -5, 5 do local cross = make("Crosswalk", Vector3.new(1.15,.09,12), Vector3.new(x+stripe*2.1,.25,z+20), Color3.fromRGB(222,226,228), Enum.Material.SmoothPlastic); cross.CanCollide = false end
	for side in {-1,1} do
		local pole = make("StreetLight", Vector3.new(.55,12,.55), Vector3.new(x+side*19,6,z+19), Color3.fromRGB(35,41,50), Enum.Material.Metal)
		local lamp = make("StreetLamp", Vector3.new(3,.45,1.3), pole.Position+Vector3.new(-side*1.2,6,0), Color3.fromRGB(255,225,160), Enum.Material.Neon); lamp.CanCollide = false
		local light = Instance.new("PointLight"); light.Color, light.Brightness, light.Range, light.Shadows, light.Parent = lamp.Color, 1.3, 24, true, lamp
	end
end end
for i = 1, 18 do local dumpster = make("Dumpster", Vector3.new(5,3.2,3), Vector3.new(rng:NextNumber(-205,205),1.8,rng:NextNumber(-155,155)), Color3.fromRGB(38,82,67), Enum.Material.Metal); dumpster.Orientation = Vector3.new(0,rng:NextInteger(0,3)*90,0) end
for i = 1, 16 do
	local car = make("CityCar", Vector3.new(7.5,2.2,4.2), Vector3.new(roadXs[rng:NextInteger(1,#roadXs)]+rng:NextNumber(-7,7),1.3,rng:NextNumber(-150,150)), facades[rng:NextInteger(1,#facades)], Enum.Material.Metal)
	car.Orientation = Vector3.new(0,rng:NextNumber(-8,8),0)
end
make("SignalCore", Vector3.new(20, 2, 20), Vector3.new(0, 1, 0), Color3.fromRGB(235, 183, 56), Enum.Material.Metal)
local spawn = Instance.new("SpawnLocation")
spawn.Name, spawn.Size, spawn.Position, spawn.Anchored, spawn.Neutral, spawn.Parent = "TitanSpawn", Vector3.new(18, 1, 18), Vector3.new(44, 2, 48), true, true, arena

local remotes = Instance.new("Folder"); remotes.Name, remotes.Parent = "TitanRemotes", RS
local choose = Instance.new("RemoteEvent"); choose.Name, choose.Parent = "ChooseClass", remotes
local ability = Instance.new("RemoteEvent"); ability.Name, ability.Parent = "UseAbility", remotes
local notice = Instance.new("RemoteEvent"); notice.Name, notice.Parent = "Notice", remotes
local sessions, enemies = {}, {}
local classes = {
	LensTitan = {color = Color3.fromRGB(55, 145, 205), health = 220, speed = 19},
	BassTitan = {color = Color3.fromRGB(215, 83, 67), health = 260, speed = 18},
}

local function armorPart(folder, root, name, size, offset, color)
	local p = Instance.new("Part"); p.Name, p.Size, p.Color, p.Material = name, size, color, Enum.Material.Metal
	p.CanCollide, p.Massless, p.CFrame, p.Parent = false, true, root.CFrame * offset, folder
	local weld = Instance.new("WeldConstraint"); weld.Part0, weld.Part1, weld.Parent = root, p, p
end
local function dress(character, className)
	local cfg, root = classes[className], character:FindFirstChild("HumanoidRootPart"); if not cfg or not root then return end
	pcall(function() character:ScaleTo(1.65) end)
	local oldArmor = character:FindFirstChild("TitanArmor"); if oldArmor then oldArmor:Destroy() end
	local armor = Instance.new("Folder"); armor.Name, armor.Parent = "TitanArmor", character
	armorPart(armor, root, "Chest", Vector3.new(6, 6.5, 3.5), CFrame.new(0, .8, 0), Color3.fromRGB(47, 53, 60))
	armorPart(armor, root, "LeftShoulder", Vector3.new(3, 1.8, 3.4), CFrame.new(-4.1, 2, 0), cfg.color)
	armorPart(armor, root, "RightShoulder", Vector3.new(3, 1.8, 3.4), CFrame.new(4.1, 2, 0), cfg.color)
	if className == "LensTitan" then
		armorPart(armor, root, "CameraHead", Vector3.new(4.8, 3.4, 4), CFrame.new(0, 6.1, 0), Color3.fromRGB(40, 46, 54))
		armorPart(armor, root, "BlueLens", Vector3.new(2.4, 2.4, .65), CFrame.new(0, 6.1, -2.3), cfg.color)
		armorPart(armor, root, "LeftCamera", Vector3.new(2.1, 1.7, 2.3), CFrame.new(-4.5, 4.2, 0), Color3.fromRGB(38, 45, 53))
		armorPart(armor, root, "RightCamera", Vector3.new(2.1, 1.7, 2.3), CFrame.new(4.5, 4.2, 0), Color3.fromRGB(38, 45, 53))
	else
		armorPart(armor, root, "LeftSpeaker", Vector3.new(3.2, 5.3, 2.2), CFrame.new(-3.5, 5.2, 0), cfg.color)
		armorPart(armor, root, "RightSpeaker", Vector3.new(3.2, 5.3, 2.2), CFrame.new(3.5, 5.2, 0), cfg.color)
		armorPart(armor, root, "BassCore", Vector3.new(3.5, 3.5, .7), CFrame.new(0, 1, -2.1), cfg.color)
	end
	local h = character:FindFirstChildOfClass("Humanoid"); if h then h.MaxHealth, h.Health, h.WalkSpeed = cfg.health, cfg.health, cfg.speed end
end
local function spawnEnemy(position)
	local model = Instance.new("Model"); model.Name, model.Parent = "MechanicalToilet", arena
	local root = Instance.new("Part"); root.Name, root.Size, root.CFrame = "Root", Vector3.new(1, 1, 1), CFrame.new(position)
	root.Anchored, root.CanCollide, root.Transparency, root.Parent = true, false, 1, model
	local function piece(name, size, offset, color, shape)
		local p = Instance.new("Part"); p.Name, p.Size, p.CFrame, p.Color = name, size, root.CFrame * offset, color
		p.Shape, p.Anchored, p.CanCollide, p.Material, p.Parent = shape or Enum.PartType.Block, true, false, Enum.Material.Metal, model
		return p
	end
	piece("Bowl", Vector3.new(7, 4, 7), CFrame.new(0, 0, 0), Color3.fromRGB(190, 193, 190), Enum.PartType.Ball)
	piece("Tank", Vector3.new(6, 7, 3), CFrame.new(0, 2.5, 3), Color3.fromRGB(175, 179, 177))
	piece("Head", Vector3.new(3.5, 3.5, 3.5), CFrame.new(0, 4.2, 0), Color3.fromRGB(205, 157, 116), Enum.PartType.Ball)
	piece("Hair", Vector3.new(3.7, 1.3, 3.6), CFrame.new(0, 5.5, .2), Color3.fromRGB(35, 29, 26), Enum.PartType.Ball)
	for _, side in {-1, 1} do piece("MechanicalLeg", Vector3.new(1.2, 6, 1.2), CFrame.new(side * 3.6, -3, 0) * CFrame.Angles(0, 0, math.rad(side * 22)), Color3.fromRGB(61, 67, 72)) end
	model.PrimaryPart = root
	table.insert(enemies, {model = model, part = root, health = 120, attackAt = 0})
end
for _, pos in ipairs({Vector3.new(-170, 4, -125), Vector3.new(170, 4, -125), Vector3.new(-170, 4, 125), Vector3.new(170, 4, 125)}) do spawnEnemy(pos) end
local function hit(player, enemy, amount)
	if not enemy.part.Parent then return end; enemy.health -= amount
	if enemy.health <= 0 then enemy.model:Destroy(); local s = sessions[player]; if s then s.score += 1; player:SetAttribute("TitanScore", s.score); notice:FireClient(player, "TOILET ENEMY DEFEATED  +1") end end
end

local function blastEffect(origin, target, color)
	local distance = (target - origin).Magnitude
	local beam = Instance.new("Part"); beam.Name, beam.Size = "AbilityEffect", Vector3.new(.65, .65, distance)
	beam.CFrame, beam.Anchored, beam.CanCollide, beam.Material, beam.Color, beam.Parent = CFrame.lookAt(origin, target) * CFrame.new(0, 0, -distance / 2), true, false, Enum.Material.Neon, color, arena
	Debris:AddItem(beam, .22)
end

ability.OnServerEvent:Connect(function(player, key, aim)
	local s, character = sessions[player], player.Character; local root = character and character:FindFirstChild("HumanoidRootPart")
	if not s or not root or typeof(aim) ~= "Vector3" or (key ~= "Q" and key ~= "E") then return end
	local now = workspace:GetServerTimeNow(); local duration = key == "Q" and 2.5 or 8
	if (s.cooldowns[key] or 0) > now then return end; s.cooldowns[key] = now + duration; player:SetAttribute(key .. "ReadyAt", now + duration)
	if key == "E" and s.class == "LensTitan" then player:SetAttribute("ShieldUntil", now + 4); notice:FireClient(player, "GUARD PULSE ACTIVE"); return end
	if key == "E" then local h = character:FindFirstChildOfClass("Humanoid"); if h then h.Health = math.min(h.MaxHealth, h.Health + 80) end; notice:FireClient(player, "RALLY DROP HEALED YOU"); return end
	for _, enemy in enemies do if enemy.part.Parent then
		local radius = s.class == "BassTitan" and 32 or 130
		local valid = (enemy.part.Position - root.Position).Magnitude < radius and (s.class == "BassTitan" or (enemy.part.Position - aim).Magnitude < 25)
		if valid then blastEffect(root.Position + Vector3.new(0, 4, 0), enemy.part.Position, s.class == "BassTitan" and Color3.fromRGB(235, 75, 62) or Color3.fromRGB(60, 175, 255)); hit(player, enemy, s.class == "BassTitan" and 42 or 55) end
	end end
end)
choose.OnServerEvent:Connect(function(player, className)
	if not classes[className] or not sessions[player] then return end
	sessions[player].class = className
	player:SetAttribute("TitanClass", className)
	player:SetAttribute("HasChosenTitan", true)
	if player.Character then dress(player.Character, className) end
	notice:FireClient(player, className == "LensTitan" and "CAMERA TITAN EQUIPPED" or "SPEAKER TITAN EQUIPPED")
end)

Players.PlayerAdded:Connect(function(player)
	sessions[player] = {class = "LensTitan", score = 0, cooldowns = {}}; player:SetAttribute("TitanClass", "LensTitan"); player:SetAttribute("TitanScore", 0); player:SetAttribute("HasChosenTitan", false)
	player.CharacterAdded:Connect(function(character) task.wait(.2); dress(character, sessions[player].class) end)
end)
Players.PlayerRemoving:Connect(function(player) sessions[player] = nil end)
RunService.Heartbeat:Connect(function(dt)
	for _, enemy in enemies do if enemy.part.Parent then local target, distance
		for _, player in Players:GetPlayers() do local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart"); if root then local d = (root.Position - enemy.part.Position).Magnitude; if not distance or d < distance then target, distance = player, d end end end
		local root = target and target.Character and target.Character:FindFirstChild("HumanoidRootPart")
		if root and distance < 150 then local delta = root.Position - enemy.part.Position; enemy.model:PivotTo(CFrame.lookAt(enemy.part.Position + delta.Unit * math.min(delta.Magnitude, 11 * dt), root.Position))
			if distance < 7 and enemy.attackAt < workspace:GetServerTimeNow() then enemy.attackAt = workspace:GetServerTimeNow() + 1.5; local h = root.Parent:FindFirstChildOfClass("Humanoid"); if h and (target:GetAttribute("ShieldUntil") or 0) < workspace:GetServerTimeNow() then h:TakeDamage(20) end end end
	end end
end)
return true
]]></string>
      </Properties>
    </Item>
  </Item>
  <Item class="StarterPlayer" referent="5">
    <Properties>
      <string name="Name">StarterPlayer</string>
    </Properties>
    <Item class="StarterPlayerScripts" referent="6">
      <Properties>
        <string name="Name">StarterPlayerScripts</string>
      </Properties>
      <Item class="LocalScript" referent="7">
        <Properties>
          <string name="Name">TitanClient</string>
          <string name="Source"><![CDATA[local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local remotes = RS:WaitForChild("TitanRemotes")
local controls = require(player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls()
local gui = Instance.new("ScreenGui"); gui.Name, gui.ResetOnSpawn, gui.Parent = "TitanHUD", false, player:WaitForChild("PlayerGui")
local function round(item) local c = Instance.new("UICorner"); c.CornerRadius, c.Parent = UDim.new(0, 12), item end
local function text(parent, value, pos, size, font, color)
	local t = Instance.new("TextLabel"); t.BackgroundTransparency, t.Position, t.Size = 1, pos, size
	t.Text, t.Font, t.TextSize, t.TextColor3, t.TextXAlignment, t.Parent = value, font or Enum.Font.Gotham, 16, color or Color3.fromRGB(244,241,232), Enum.TextXAlignment.Left, parent; return t
end
local panel = Instance.new("Frame"); panel.Position, panel.Size, panel.BackgroundColor3, panel.BackgroundTransparency, panel.Parent = UDim2.fromOffset(22,22), UDim2.fromOffset(360,172), Color3.fromRGB(24,31,38), .08, gui; round(panel)
local title = text(panel,"TITAN SIGNAL CLASH",UDim2.fromOffset(18,14),UDim2.fromOffset(320,28),Enum.Font.GothamBlack,Color3.fromRGB(235,183,56)); title.TextSize=21
local classText=text(panel,"LENS TITAN",UDim2.fromOffset(18,49),UDim2.fromOffset(250,24),Enum.Font.GothamBold)
local healthText=text(panel,"HEALTH -- / --",UDim2.fromOffset(18,78),UDim2.fromOffset(250,22),Enum.Font.GothamBold,Color3.fromRGB(101,211,132))
local scoreText=text(panel,"RAIDERS DEFEATED 0",UDim2.fromOffset(18,106),UDim2.fromOffset(270,22),Enum.Font.GothamBold)
local abilities=text(panel,"[Q] FOCUS BEAM     [E] GUARD PULSE",UDim2.fromOffset(18,137),UDim2.fromOffset(330,22),Enum.Font.GothamBold,Color3.fromRGB(178,190,199)); abilities.TextSize=12
local picker=Instance.new("Frame"); picker.AnchorPoint,picker.Position,picker.Size,picker.BackgroundColor3,picker.BackgroundTransparency,picker.Parent=Vector2.new(.5,0),UDim2.new(.5,0,0,22),UDim2.fromOffset(330,105),Color3.fromRGB(24,31,38),.08,gui; round(picker)
local pickTitle=text(picker,"CHOOSE YOUR TITAN",UDim2.fromOffset(18,10),UDim2.fromOffset(294,25),Enum.Font.GothamBlack); pickTitle.TextXAlignment=Enum.TextXAlignment.Center
local choosing = not player:GetAttribute("HasChosenTitan")
picker.Visible = choosing
if choosing then controls:Disable() end

local function finishChoosing()
	if not choosing then return end
	choosing = false
	picker.Visible = false
	controls:Enable()
	local humanoid = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
	if humanoid then humanoid:Move(Vector3.zero, false) end
end

local function button(value,x,color,className)
	local b=Instance.new("TextButton"); b.Position,b.Size,b.BackgroundColor3,b.Text,b.TextColor3,b.Font,b.TextSize,b.Parent=UDim2.fromOffset(x,50),UDim2.fromOffset(150,42),color,value,Color3.new(1,1,1),Enum.Font.GothamBold,14,picker; round(b)
	b.MouseButton1Click:Connect(function()
		if not choosing then return end
		b.Text = "SELECTED"
		for _, item in picker:GetChildren() do if item:IsA("TextButton") then item.Active = false end end
		remotes.ChooseClass:FireServer(className)
		finishChoosing()
	end)
end
button("LENS TITAN",10,Color3.fromRGB(55,145,205),"LensTitan"); button("BASS TITAN",170,Color3.fromRGB(215,83,67),"BassTitan")
player:GetAttributeChangedSignal("HasChosenTitan"):Connect(function()
	if player:GetAttribute("HasChosenTitan") then finishChoosing() end
end)
player.CharacterAdded:Connect(function(character)
	if not choosing then return end
	local humanoid = character:WaitForChild("Humanoid")
	humanoid:Move(Vector3.zero, false)
end)
local notice=text(gui,"",UDim2.new(.5,-300,.2,0),UDim2.fromOffset(600,50),Enum.Font.GothamBlack,Color3.fromRGB(235,183,56)); notice.TextXAlignment,notice.TextSize=Enum.TextXAlignment.Center,25
remotes.Notice.OnClientEvent:Connect(function(message) notice.Text=message; task.delay(1.5,function() if notice.Text==message then notice.Text="" end end) end)
local function fire(key) local camera=workspace.CurrentCamera; remotes.UseAbility:FireServer(key,camera.CFrame.Position+camera.CFrame.LookVector*100) end
UIS.InputBegan:Connect(function(input,processed) if processed then return end; if input.KeyCode==Enum.KeyCode.Q then fire("Q") elseif input.KeyCode==Enum.KeyCode.E then fire("E") end end)
RunService.RenderStepped:Connect(function()
	local className=player:GetAttribute("TitanClass") or "LensTitan"; classText.Text=className=="BassTitan" and "BASS TITAN" or "LENS TITAN"
	abilities.Text=className=="BassTitan" and "[Q] SONIC BURST     [E] RALLY DROP" or "[Q] FOCUS BEAM     [E] GUARD PULSE"; scoreText.Text="RAIDERS DEFEATED "..(player:GetAttribute("TitanScore") or 0)
	local h=player.Character and player.Character:FindFirstChildOfClass("Humanoid"); if h then healthText.Text=string.format("HEALTH %d / %d",math.ceil(h.Health),math.ceil(h.MaxHealth)) end
end)
return true
]]></string>
        </Properties>
      </Item>
    </Item>
  </Item>
</roblox>