-- GAME SERVER SCRIPT (~3000 chars) local gs=Instance.new("Script",game.ServerScriptService)gs.Name="GameServer" gs.Source=[[ local RS=game:GetService("ReplicatedStorage")local P=game:GetService("Players") local E=RS:WaitForChild("Events") local HE=E.HitEvent KE=E.KillEvent DE=E.DamageEvent PDE=E.PlayerDiedEvent EKE=E.EnemyKilledEvent HME=E.HitMarkerEvent P.PlayerAdded:Connect(function(pl) local ls=Instance.new("Folder",pl)ls.Name="leaderstats" local k=Instance.new("IntValue",ls)k.Name="Kills"k.Value=0 local d=Instance.new("IntValue",ls)d.Name="Deaths"d.Value=0 pl.CharacterAdded:Connect(function(c) local h=c:WaitForChild("Humanoid")h.MaxHealth=100 h.Health=100 h.WalkSpeed=18 h.Died:Connect(function()d.Value=d.Value+1 PDE:FireClient(pl,pl.Name)task.delay(4,function()pl:LoadCharacter()end)end) end)end) HE.OnServerEvent:Connect(function(pl,hp,dmg,hs,wn) if hp and hp.Parent and hp.Parent:FindFirstChild("Humanoid")then local hm=hp.Parent.Humanoid if hm and hm.Health>0 then local d=hs and dmg*2.5 or dmg hm:TakeDamage(d)HME:FireClient(pl,hs) local tp=P:GetPlayerFromCharacter(hp.Parent) if tp and tp~=pl then DE:FireClient(tp,d)end if hm.Health<=0 then KE:FireClient(pl,"Enemy")pl.leaderstats.Kills.Value=pl.leaderstats.Kills.Value+1 end end end end) EKE.OnServerEvent:Connect(function(pl,en) if pl and pl:FindFirstChild("leaderstats")then pl.leaderstats.Kills.Value=pl.leaderstats.Kills.Value+1 end end) local MX=10 local SP={Vector3.new(-150,3,-150),Vector3.new(150,3,-150),Vector3.new(-150,3,150),Vector3.new(150,3,150),Vector3.new(0,3,-150),Vector3.new(0,3,150),Vector3.new(-150,3,0),Vector3.new(150,3,0),Vector3.new(-100,3,-100),Vector3.new(100,3,100)} local PP={Vector3.new(-60,3,-80),Vector3.new(70,3,-60),Vector3.new(-40,3,70),Vector3.new(80,3,80),Vector3.new(0,3,-150),Vector3.new(-120,3,-120),Vector3.new(120,3,-120),Vector3.new(-120,3,120),Vector3.new(120,3,120),Vector3.new(0,3,0)} local function mkEnemy(sp) local m=Instance.new("Model",workspace)m.Name="EnemySoldier" local t=Instance.new("Part",m)t.Name="Torso"t.Size=Vector3.new(3,3,2)t.Position=sp t.BrickColor=BrickColor.new("Dark green")t.Material=Enum.Material.Plastic local h=Instance.new("Part",m)h.Name="Head"h.Size=Vector3.new(2,2,2)h.Position=sp+Vector3.new(0,2.5,0)h.BrickColor=BrickColor.new("Medium stone grey") local ll=Instance.new("Part",m)ll.Name="Left Leg"ll.Size=Vector3.new(1,3,1)ll.Position=sp+Vector3.new(-0.75,-2.5,0)ll.BrickColor=BrickColor.new("Dark green") local rl=Instance.new("Part",m)rl.Name="Right Leg"rl.Size=Vector3.new(1,3,1)rl.Position=sp+Vector3.new(0.75,-2.5,0)rl.BrickColor=BrickColor.new("Dark green") local hm=Instance.new("Humanoid",m)hm.MaxHealth=100 hm.Health=100 hm.WalkSpeed=12 local rp=Instance.new("Part",m)rp.Name="HumanoidRootPart"rp.Size=Vector3.new(2,2,1)rp.Position=sp rp.Transparency=1 rp.CanCollide=false local w1=Instance.new("Weld",rp)w1.Part0=rp w1.Part1=t local w2=Instance.new("Weld",t)w2.Part0=t w2.Part1=h local tp=PP[math.random(#PP)] hm.Died:Connect(function() for _,p in ipairs(P:GetPlayers())do local c=p.Character if c and c:FindFirstChild("HumanoidRootPart")then EKE:FireClient(p,m.Name)end end task.delay(8,function()if m and m.Parent then m:Destroy()end end) task.delay(12,function()local cnt=0 for _,o in pairs(workspace:GetChildren())do if o.Name=="EnemySoldier"then cnt=cnt+1 end end if cnt0 do task.wait(0.5)local r=m:FindFirstChild("HumanoidRootPart")if r then hm:MoveTo(tp)if(r.Position-tp).Magnitude<5 then tp=PP[math.random(#PP)]end end end end)() coroutine.wrap(function()local ls=0 while m.Parent and hm.Health>0 do task.wait(0.3)local r=m:FindFirstChild("HumanoidRootPart")if not r then continue end for _,pl in ipairs(P:GetPlayers())do if pl.Character and pl.Character:FindFirstChild("HumanoidRootPart")then local pr=pl.Character.HumanoidRootPart local d=(pr.Position-r.Position).Magnitude if d<60 then hm:MoveTo(pr.Position)if d<45 and tick()-ls>1.5 then ls=tick()local ph=pl.Character:FindFirstChild("Humanoid")if ph and ph.Health>0 then ph:TakeDamage(8+math.random(7))DE:FireClient(pl,10)end end elseif d>90 then hm:MoveTo(tp)end end end end end)() end for i=1,MX do task.delay(i*0.5,function()mkEnemy(SP[i])end)end print("[GameServer] Loaded!") ]] print("SERVER DONE")