<roblox version="4">
  <Item class="ReplicatedStorage" referent="0">
    <Properties>
      <string name="Name">ReplicatedStorage</string>
    </Properties>
    <Item class="Folder" referent="1">
      <Properties>
        <string name="Name">LabShared</string>
      </Properties>
      <Item class="ModuleScript" referent="2">
        <Properties>
          <string name="Name">Config</string>
          <string name="Source"><![CDATA[return {
 Abilities={Q={name="Pulse Strike",cooldown=2.5,stamina=18,damage=28,range=18},E={name="Arc Dash",cooldown=4,stamina=24,damage=20,range=24},R={name="Gravity Ring",cooldown=7,stamina=36,damage=38,range=28},F={name="Overdrive",cooldown=12,stamina=45,damage=55,range=34}},
 Loadouts={Vanguard={speed=18,color=Color3.fromRGB(68,180,255)},Striker={speed=22,color=Color3.fromRGB(255,105,91)},Warden={speed=16,color=Color3.fromRGB(120,230,155)}}
}
]]></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">LabServer</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 TweenService=game:GetService("TweenService")
local Lighting=game:GetService("Lighting")
local Config=require(RS:WaitForChild("LabShared"):WaitForChild("Config"))

local old=workspace:FindFirstChild("NakelSystemsLab") if old then old:Destroy() end
local lab=Instance.new("Folder",workspace) lab.Name="NakelSystemsLab"
local remotes=Instance.new("Folder",RS) remotes.Name="LabRemotes"
local action=Instance.new("RemoteEvent",remotes) action.Name="Action"
local state=Instance.new("RemoteEvent",remotes) state.Name="State"
local notice=Instance.new("RemoteEvent",remotes) notice.Name="Notice"
local sessions,dummies,placed={},{},{}

local C={ink=Color3.fromRGB(20,28,40),blue=Color3.fromRGB(68,180,255),coral=Color3.fromRGB(255,105,91),green=Color3.fromRGB(120,230,155),gold=Color3.fromRGB(255,200,82),purple=Color3.fromRGB(170,105,255),white=Color3.fromRGB(238,244,250),red=Color3.fromRGB(238,71,82)}
local function part(parent,name,size,cf,color,material)
 local p=Instance.new("Part") p.Name=name p.Size=size p.CFrame=cf p.Color=color p.Material=material or Enum.Material.SmoothPlastic p.Anchored=true p.TopSurface=Enum.SurfaceType.Smooth p.BottomSurface=Enum.SurfaceType.Smooth p.Parent=parent return p
end
local function label(p,title,subtitle)
 local g=Instance.new("SurfaceGui",p) g.Face=Enum.NormalId.Front g.SizingMode=Enum.SurfaceGuiSizingMode.PixelsPerStud g.PixelsPerStud=28
 local t=Instance.new("TextLabel",g) t.Size=UDim2.fromScale(1,.58) t.BackgroundTransparency=1 t.Text=title t.Font=Enum.Font.GothamBlack t.TextColor3=C.white t.TextScaled=true
 local s=Instance.new("TextLabel",g) s.Position=UDim2.fromScale(0,.58) s.Size=UDim2.fromScale(1,.3) s.BackgroundTransparency=1 s.Text=subtitle s.Font=Enum.Font.GothamMedium s.TextColor3=Color3.fromRGB(180,198,216) s.TextScaled=true
end
local function zone(name,z,color,subtitle)
 part(lab,name.."Floor",Vector3.new(130,2,110),CFrame.new(0,0,z),Color3.fromRGB(43,55,69),Enum.Material.Concrete)
 local sign=part(lab,name.."Sign",Vector3.new(70,18,2),CFrame.new(0,14,z-53),color,Enum.Material.Metal) label(sign,name,subtitle)
 for _,x in ipairs({-62,62}) do part(lab,"Edge",Vector3.new(4,8,110),CFrame.new(x,4,z),color,Enum.Material.Neon) end
end

part(lab,"WorldBase",Vector3.new(360,4,1250),CFrame.new(0,-3,0),Color3.fromRGB(28,38,51),Enum.Material.Asphalt)
part(lab,"Hub",Vector3.new(180,2,130),CFrame.new(0,0,0),C.ink,Enum.Material.Metal)
local hubSign=part(lab,"HubSign",Vector3.new(90,22,3),CFrame.new(0,15,-55),C.blue,Enum.Material.Metal) label(hubSign,"NAKEL SYSTEMS LAB","8 ORIGINAL PLAYABLE SYSTEMS")
local spawn=Instance.new("SpawnLocation",lab) spawn.Name="LabSpawn" spawn.Size=Vector3.new(18,1,18) spawn.CFrame=CFrame.new(0,2,20) spawn.Anchored=true spawn.Neutral=true spawn.Color=C.blue spawn.Material=Enum.Material.Neon

local zones={{"COMBAT LAB",150,C.blue,"Q E R F · stamina + cooldowns"},{"PLACEMENT GRID",290,C.green,"B to build · rotate + validate"},{"COMPANION COMBOS",430,C.purple,"G summon · click combo"},{"LOADOUT VAULT",570,C.gold,"1 2 3 instant server loadouts"},{"RAIL RUN",710,C.blue,"mount a slope-aware traversal line"},{"PUSH ARENA",850,C.coral,"P physics impulse challenge"},{"BOMBER TILES",1010,C.red,"timed danger tiles + survival"}}
for _,v in ipairs(zones) do zone(table.unpack(v)) end

local function dummy(pos,name)
 local m=Instance.new("Model",lab) m.Name=name or "TrainingDummy"
 local root=part(m,"HumanoidRootPart",Vector3.new(3,5,2),CFrame.new(pos),Color3.fromRGB(92,104,118),Enum.Material.Metal) root.Anchored=true
 local head=part(m,"Head",Vector3.new(3,3,3),CFrame.new(pos+Vector3.new(0,4,0)),C.white) head.Shape=Enum.PartType.Ball
 local h=Instance.new("Humanoid",m) h.MaxHealth=200 h.Health=200 m.PrimaryPart=root
 table.insert(dummies,m) return m
end
for x=-36,36,24 do dummy(Vector3.new(x,3,165),"CombatDummy") end
for x=-32,32,32 do dummy(Vector3.new(x,3,445),"ComboDummy") end
for x=-36,36,24 do local d=dummy(Vector3.new(x,3,865),"PushTarget") d.HumanoidRootPart.Anchored=false d.HumanoidRootPart:SetNetworkOwner(nil) end

for x=-50,50,10 do for z=265,315,10 do local tile=part(lab,"GridTile",Vector3.new(9,.3,9),CFrame.new(x,1.2,z),Color3.fromRGB(62,78,94),Enum.Material.SmoothPlastic) tile:SetAttribute("PlacementTile",true) end end
for _,x in ipairs({-34,0,34}) do
 local pad=part(lab,"LoadoutPad",Vector3.new(24,1,24),CFrame.new(x,1.2,575),({C.blue,C.coral,C.green})[x==-34 and 1 or x==0 and 2 or 3],Enum.Material.Neon)
 local names={[-34]="VANGUARD",[0]="STRIKER",[34]="WARDEN"} label(part(lab,"LoadoutLabel",Vector3.new(24,7,1),CFrame.new(x,7,563),C.ink),names[x],"press "..(x==-34 and "1" or x==0 and "2" or "3"))
end

local railPoints={Vector3.new(-52,5,735),Vector3.new(-25,18,750),Vector3.new(5,8,770),Vector3.new(35,26,790),Vector3.new(52,7,810)}
for i=1,#railPoints-1 do local a,b=railPoints[i],railPoints[i+1] local d=(b-a).Magnitude local p=part(lab,"Rail",Vector3.new(2,2,d),CFrame.lookAt((a+b)/2,b),C.blue,Enum.Material.Neon) p.CanCollide=false end
local railPad=part(lab,"RailMount",Vector3.new(16,1,16),CFrame.new(railPoints[1]-Vector3.new(0,4,0)),C.blue,Enum.Material.Neon) railPad:SetAttribute("RailMount",true)

local bomberTiles={}
for x=-45,45,15 do for z=980,1040,15 do local p=part(lab,"BomberTile",Vector3.new(13,1,13),CFrame.new(x,1,z),Color3.fromRGB(77,91,108),Enum.Material.Metal) table.insert(bomberTiles,p) end end

local function effect(pos,color,radius)
 local p=part(lab,"Effect",Vector3.new(1,1,1),CFrame.new(pos),color,Enum.Material.Neon) p.Shape=Enum.PartType.Ball p.CanCollide=false p.Transparency=.2
 TweenService:Create(p,TweenInfo.new(.28),{Size=Vector3.new(radius*2,radius*2,radius*2),Transparency=1}):Play() Debris:AddItem(p,.35)
end
local function nearestDummy(pos,range,filter)
 local best,dist
 for _,m in ipairs(dummies) do if m.Parent and (not filter or m.Name==filter) then local r=m:FindFirstChild("HumanoidRootPart") local h=m:FindFirstChildOfClass("Humanoid") if r and h and h.Health>0 then local d=(r.Position-pos).Magnitude if d<=range and (not dist or d<dist) then best,dist=m,d end end end end
 return best
end
local function damageAround(player,amount,range)
 local root=player.Character and player.Character:FindFirstChild("HumanoidRootPart") if not root then return end
 effect(root.Position,C.blue,range)
 for _,m in ipairs(dummies) do local r=m:FindFirstChild("HumanoidRootPart") local h=m:FindFirstChildOfClass("Humanoid") if r and h and (r.Position-root.Position).Magnitude<=range then h:TakeDamage(amount) if h.Health<=0 then task.delay(2,function() if h.Parent then h.Health=h.MaxHealth end end) end end end
end

local function send(player) local s=sessions[player] if s then state:FireClient(player,{stamina=s.stamina,loadout=s.loadout,combo=s.combo,placed=s.placed}) end end
local function chooseLoadout(player,name)
 local cfg=Config.Loadouts[name] local s=sessions[player] local h=player.Character and player.Character:FindFirstChildOfClass("Humanoid") if not cfg or not s or not h then return end
 s.loadout=name h.WalkSpeed=cfg.speed player:SetAttribute("LabLoadout",name) notice:FireClient(player,name.." LOADOUT EQUIPPED") send(player)
end
local function rideRail(player)
 local s=sessions[player] local root=player.Character and player.Character:FindFirstChild("HumanoidRootPart") if not s or not root or s.rail then return end s.rail=true root.Anchored=true
 task.spawn(function()
  for i=1,#railPoints do local target=railPoints[i]+Vector3.new(0,4,0) local current=root.Position local slope=target.Y-current.Y local speed=math.clamp(46-slope*1.1,24,68) local duration=(target-current).Magnitude/speed local tween=TweenService:Create(root,TweenInfo.new(duration,Enum.EasingStyle.Linear),{CFrame=CFrame.lookAt(target,target+(i<#railPoints and railPoints[i+1]-target or Vector3.new(0,0,-1)))}) tween:Play() tween.Completed:Wait() end
  root.Anchored=false s.rail=false notice:FireClient(player,"RAIL RUN COMPLETE")
 end)
end

action.OnServerEvent:Connect(function(player,kind,data)
 local s=sessions[player] local char=player.Character local root=char and char:FindFirstChild("HumanoidRootPart") if not s or not root then return end
 if kind=="Ability" and Config.Abilities[data] then local a=Config.Abilities[data] local now=workspace:GetServerTimeNow() if (s.cooldowns[data] or 0)>now or s.stamina<a.stamina then return end s.cooldowns[data]=now+a.cooldown s.stamina-=a.stamina damageAround(player,a.damage,a.range) notice:FireClient(player,a.name:upper()) send(player)
 elseif kind=="Loadout" then chooseLoadout(player,data)
 elseif kind=="Place" and typeof(data)=="table" and typeof(data.position)=="Vector3" then if (data.position-root.Position).Magnitude>120 or #placed>=80 then return end local x=math.round(data.position.X/5)*5 local z=math.round(data.position.Z/5)*5 local key=x..":"..z if placed[key] then return end placed[key]=true local b=part(lab,"PlacedBlock",Vector3.new(8,8,8),CFrame.new(x,5,z)*CFrame.Angles(0,math.rad(90*(data.rotation or 0)),0),C.green,Enum.Material.Metal) b:SetAttribute("PlacedBy",player.UserId) s.placed+=1 send(player)
 elseif kind=="Summon" then s.summoned=not s.summoned player:SetAttribute("CompanionSummoned",s.summoned) notice:FireClient(player,s.summoned and "COMPANION ONLINE" or "COMPANION DISMISSED")
 elseif kind=="Combo" and s.summoned then local now=os.clock() s.combo=(now-s.comboAt<1.15) and math.min(s.combo+1,4) or 1 s.comboAt=now local target=nearestDummy(root.Position,22,"ComboDummy") if target then target:FindFirstChildOfClass("Humanoid"):TakeDamage(8+s.combo*5) effect(target.HumanoidRootPart.Position,C.purple,4+s.combo) end send(player)
 elseif kind=="Push" then local target=nearestDummy(root.Position,20,"PushTarget") if target then local tr=target.HumanoidRootPart tr.AssemblyLinearVelocity=(tr.Position-root.Position).Unit*75+Vector3.new(0,34,0) effect(tr.Position,C.coral,6) end
 elseif kind=="Rail" then rideRail(player) end
end)

local danger={}
task.spawn(function()
 while task.wait(8) do
  danger={} for _,p in ipairs(bomberTiles) do p.Color=Color3.fromRGB(77,91,108) end
  for i=1,math.min(10,#bomberTiles) do local p=bomberTiles[math.random(1,#bomberTiles)] danger[p]=true p.Color=C.gold end
  notice:FireAllClients("BOMBER WARNING · MOVE TO A SAFE TILE") task.wait(3)
  for p in pairs(danger) do p.Color=C.red effect(p.Position,C.red,7) for _,plr in ipairs(Players:GetPlayers()) do local r=plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") local h=plr.Character and plr.Character:FindFirstChildOfClass("Humanoid") if r and h and math.abs(r.Position.X-p.Position.X)<7 and math.abs(r.Position.Z-p.Position.Z)<7 and math.abs(r.Position.Y-p.Position.Y)<10 then h:TakeDamage(55) end end end
  task.wait(1) for p in pairs(danger) do p.Color=Color3.fromRGB(77,91,108) end
 end
end)

local function setup(player)
 sessions[player]={stamina=100,loadout="Vanguard",cooldowns={},combo=0,comboAt=0,placed=0,summoned=false,rail=false}
 player:SetAttribute("LabLoadout","Vanguard") player:SetAttribute("CompanionSummoned",false)
 player.CharacterAdded:Connect(function(c) local h=c:WaitForChild("Humanoid") h.WalkSpeed=Config.Loadouts[sessions[player].loadout].speed task.wait(.2) send(player) end)
end
Players.PlayerAdded:Connect(setup) for _,p in ipairs(Players:GetPlayers()) do setup(p) end
Players.PlayerRemoving:Connect(function(p) sessions[p]=nil end)
RunService.Heartbeat:Connect(function(dt) for p,s in pairs(sessions) do if s.stamina<100 then s.stamina=math.min(100,s.stamina+12*dt) end end end)
task.spawn(function() while task.wait(.2) do for p in pairs(sessions) do send(p) end end end)

Lighting.ClockTime=16 Lighting.Brightness=2.2 Lighting.Ambient=Color3.fromRGB(86,98,115) Lighting.OutdoorAmbient=Color3.fromRGB(126,139,153) Lighting.Technology=Enum.Technology.Future
local a=Lighting:FindFirstChildOfClass("Atmosphere") or Instance.new("Atmosphere",Lighting) a.Density=.2 a.Haze=.8 a.Color=Color3.fromRGB(197,218,238)
]]></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">LabClient</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("LabRemotes")
local Config=require(RS:WaitForChild("LabShared"):WaitForChild("Config"))

local gui=Instance.new("ScreenGui",player:WaitForChild("PlayerGui")) gui.Name="NakelLabHUD" gui.ResetOnSpawn=false
local function corner(o,r) local c=Instance.new("UICorner",o) c.CornerRadius=UDim.new(0,r or 10) end
local function text(parent,value,pos,size,font,color)
 local t=Instance.new("TextLabel",parent) t.BackgroundTransparency=1 t.Position=pos t.Size=size t.Text=value t.Font=font or Enum.Font.Gotham t.TextSize=14 t.TextColor3=color or Color3.fromRGB(238,244,250) t.TextXAlignment=Enum.TextXAlignment.Left return t
end
local panel=Instance.new("Frame",gui) panel.Position=UDim2.fromOffset(18,18) panel.Size=UDim2.fromOffset(390,196) panel.BackgroundColor3=Color3.fromRGB(15,23,34) panel.BackgroundTransparency=.06 corner(panel,14)
local title=text(panel,"NAKEL SYSTEMS LAB",UDim2.fromOffset(18,13),UDim2.fromOffset(350,25),Enum.Font.GothamBlack,Color3.fromRGB(68,180,255)) title.TextSize=20
local mode=text(panel,"8 PLAYABLE SYSTEMS",UDim2.fromOffset(18,42),UDim2.fromOffset(340,18),Enum.Font.GothamBold,Color3.fromRGB(170,190,210)) mode.TextSize=11
local staminaBack=Instance.new("Frame",panel) staminaBack.Position=UDim2.fromOffset(18,69) staminaBack.Size=UDim2.fromOffset(354,13) staminaBack.BackgroundColor3=Color3.fromRGB(43,56,70) corner(staminaBack,7)
local staminaBar=Instance.new("Frame",staminaBack) staminaBar.Size=UDim2.fromScale(1,1) staminaBar.BackgroundColor3=Color3.fromRGB(120,230,155) corner(staminaBar,7)
local status=text(panel,"STAMINA 100  ·  VANGUARD",UDim2.fromOffset(18,88),UDim2.fromOffset(350,20),Enum.Font.GothamBold) status.TextSize=12
local controls=text(panel,"Q/E/R/F abilities  ·  B build  ·  G companion  ·  click combo\n1/2/3 loadouts  ·  T rail  ·  P push",UDim2.fromOffset(18,116),UDim2.fromOffset(350,52),Enum.Font.GothamMedium,Color3.fromRGB(190,204,218)) controls.TextSize=12 controls.TextWrapped=true controls.TextYAlignment=Enum.TextYAlignment.Top
local hint=text(panel,"Walk forward through each color-coded lab.",UDim2.fromOffset(18,171),UDim2.fromOffset(350,18),Enum.Font.GothamBold,Color3.fromRGB(255,200,82)) hint.TextSize=11

local hotbar=Instance.new("Frame",gui) hotbar.AnchorPoint=Vector2.new(.5,1) hotbar.Position=UDim2.new(.5,0,1,-22) hotbar.Size=UDim2.fromOffset(500,64) hotbar.BackgroundTransparency=1
local abilityLabels={}
for i,key in ipairs({"Q","E","R","F"}) do
 local a=Config.Abilities[key] local b=Instance.new("Frame",hotbar) b.Position=UDim2.fromOffset((i-1)*126,0) b.Size=UDim2.fromOffset(118,60) b.BackgroundColor3=Color3.fromRGB(20,31,45) b.BackgroundTransparency=.05 corner(b,10)
 local k=text(b,key,UDim2.fromOffset(10,7),UDim2.fromOffset(24,20),Enum.Font.GothamBlack,Color3.fromRGB(68,180,255)) k.TextSize=17
 local n=text(b,a.name,UDim2.fromOffset(10,31),UDim2.fromOffset(98,18),Enum.Font.GothamBold) n.TextSize=10 n.TextWrapped=true abilityLabels[key]=b
end
local notice=text(gui,"",UDim2.new(.5,-350,.22,0),UDim2.fromOffset(700,52),Enum.Font.GothamBlack,Color3.fromRGB(255,200,82)) notice.TextXAlignment=Enum.TextXAlignment.Center notice.TextSize=24
remotes.Notice.OnClientEvent:Connect(function(message) notice.Text=message task.delay(1.7,function() if notice.Text==message then notice.Text="" end end) end)

local snapshot={stamina=100,loadout="Vanguard",combo=0,placed=0}
remotes.State.OnClientEvent:Connect(function(data) snapshot=data staminaBar.Size=UDim2.fromScale(math.clamp(data.stamina/100,0,1),1) status.Text=string.format("STAMINA %d  ·  %s  ·  COMBO %d  ·  BUILDS %d",math.floor(data.stamina),string.upper(data.loadout),data.combo,data.placed) end)

local localReady={}
local buildMode=false
local rotation=0
local preview=Instance.new("Part") preview.Name="PlacementPreview" preview.Size=Vector3.new(8,8,8) preview.Anchored=true preview.CanCollide=false preview.Material=Enum.Material.ForceField preview.Transparency=.35 preview.Color=Color3.fromRGB(120,230,155) preview.Parent=workspace preview.CFrame=CFrame.new(0,-100,0)
local mouse=player:GetMouse()
local function setBuild(active) buildMode=active preview.Transparency=active and .35 or 1 hint.Text=active and "BUILD MODE · click to place · R rotate · B exit" or "Walk forward through each color-coded lab." end

local companion=Instance.new("Model") companion.Name="LocalCompanion"
local core=Instance.new("Part",companion) core.Name="Core" core.Size=Vector3.new(3.5,3.5,3.5) core.Shape=Enum.PartType.Ball core.Material=Enum.Material.Neon core.Color=Color3.fromRGB(170,105,255) core.Anchored=true core.CanCollide=false
for _,x in ipairs({-2.5,2.5}) do local wing=Instance.new("Part",companion) wing.Size=Vector3.new(2.5,.6,3) wing.Material=Enum.Material.Metal wing.Color=Color3.fromRGB(48,55,70) wing.Anchored=true wing.CanCollide=false wing.CFrame=CFrame.new(x,0,0) end
companion.PrimaryPart=core companion.Parent=workspace
local summoned=false
player:GetAttributeChangedSignal("CompanionSummoned"):Connect(function() summoned=player:GetAttribute("CompanionSummoned")==true for _,p in ipairs(companion:GetChildren()) do if p:IsA("BasePart") then p.Transparency=summoned and 0 or 1 end end end)
for _,p in ipairs(companion:GetChildren()) do if p:IsA("BasePart") then p.Transparency=1 end end

local function useAbility(key)
 local a=Config.Abilities[key] local now=os.clock() if (localReady[key] or 0)>now or snapshot.stamina<a.stamina then return end localReady[key]=now+a.cooldown remotes.Action:FireServer("Ability",key)
 local frame=abilityLabels[key] frame.BackgroundColor3=Color3.fromRGB(68,78,92) task.delay(a.cooldown,function() if frame.Parent then frame.BackgroundColor3=Color3.fromRGB(20,31,45) end end)
end
UIS.InputBegan:Connect(function(input,processed)
 if processed then return end local key=input.KeyCode
 if key==Enum.KeyCode.B then setBuild(not buildMode)
 elseif key==Enum.KeyCode.R and buildMode then rotation=(rotation+1)%4
 elseif key==Enum.KeyCode.Q then useAbility("Q") elseif key==Enum.KeyCode.E then useAbility("E") elseif key==Enum.KeyCode.R then useAbility("R") elseif key==Enum.KeyCode.F then useAbility("F")
 elseif key==Enum.KeyCode.One then remotes.Action:FireServer("Loadout","Vanguard") elseif key==Enum.KeyCode.Two then remotes.Action:FireServer("Loadout","Striker") elseif key==Enum.KeyCode.Three then remotes.Action:FireServer("Loadout","Warden")
 elseif key==Enum.KeyCode.G then remotes.Action:FireServer("Summon") elseif key==Enum.KeyCode.P then remotes.Action:FireServer("Push") elseif key==Enum.KeyCode.T then remotes.Action:FireServer("Rail") end
end)
mouse.Button1Down:Connect(function()
 if buildMode and preview.Transparency<1 and preview.Color==Color3.fromRGB(120,230,155) then remotes.Action:FireServer("Place",{position=preview.Position,rotation=rotation})
 elseif summoned then remotes.Action:FireServer("Combo") end
end)

RunService.RenderStepped:Connect(function()
 local char=player.Character local root=char and char:FindFirstChild("HumanoidRootPart")
 if buildMode and root then
  local ray=workspace.CurrentCamera:ViewportPointToRay(mouse.X,mouse.Y) local result=workspace:Raycast(ray.Origin,ray.Direction*500) if result then local p=result.Position local x,z=math.round(p.X/5)*5,math.round(p.Z/5)*5 local valid=math.abs(x)<=58 and z>=250 and z<=330 preview.CFrame=CFrame.new(x,5,z)*CFrame.Angles(0,math.rad(rotation*90),0) preview.Color=valid and Color3.fromRGB(120,230,155) or Color3.fromRGB(238,71,82) end
 end
 if summoned and root then
  local cf=root.CFrame*CFrame.new(4+math.sin(os.clock()*2),3+math.sin(os.clock()*3)*.35,2) companion:PivotTo(cf*CFrame.Angles(0,os.clock()*1.4,0))
 end
 for key,ready in pairs(localReady) do if ready>os.clock() then local left=ready-os.clock() local children=abilityLabels[key]:GetChildren() for _,v in ipairs(children) do if v:IsA("TextLabel") and v.Text~=key then v.Text=string.format("%.1fs",left) end end elseif ready~=0 then localReady[key]=0 local children=abilityLabels[key]:GetChildren() for _,v in ipairs(children) do if v:IsA("TextLabel") and v.Text~=key then v.Text=Config.Abilities[key].name end end end end
end)
]]></string>
        </Properties>
      </Item>
    </Item>
  </Item>
  <Item class="Workspace" referent="8">
    <Properties>
      <string name="Name">Workspace</string>
      <bool name="NeedsPivotMigration">false</bool>
      <bool name="StreamingEnabled">true</bool>
    </Properties>
  </Item>
</roblox>