- inject_gta_city.py: Full GTA-style city with 20 buildings, roads, cars, street lights, traffic lights, trees, 15 human enemies with varied skin/clothing, and 10 COD weapons with visible gun models - inject_bg.py: Background injection using SendMessage/PostMessage Win32 API - inject_bg2.py: PostMessage approach targeting main window for WPF apps - inject_cod_final.py: Working COD game injection (7-step sequential) - cod_inject.py: Combined COD game builder with proper Studio launch - roblox-fps-p1-p6: Split Lua scripts for multi-part injection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
347 lines
24 KiB
Python
347 lines
24 KiB
Python
"""
|
|
GTA City Expansion + Visible Weapons + Human Enemies
|
|
Inject into Roblox Studio command bar (must be pre-focused by user)
|
|
"""
|
|
import ctypes, ctypes.wintypes, subprocess, time, sys, os
|
|
|
|
user32 = ctypes.windll.user32
|
|
def key_down(vk): user32.keybd_event(vk, 0, 0, 0)
|
|
def key_up(vk): user32.keybd_event(vk, 0, 2, 0)
|
|
def press(vk): key_down(vk); time.sleep(0.02); key_up(vk)
|
|
|
|
def paste_execute(code):
|
|
tmp = os.path.join(os.environ["TEMP"], "rbx.lua")
|
|
with open(tmp, "w", encoding="utf-8") as f:
|
|
f.write(code)
|
|
subprocess.run(["powershell", "-Command", f"Get-Content '{tmp}' -Raw | Set-Clipboard"], capture_output=True, timeout=10)
|
|
time.sleep(0.2)
|
|
key_down(0x11); key_down(0x41); time.sleep(0.02); key_up(0x41); key_up(0x11)
|
|
time.sleep(0.05)
|
|
key_down(0x11); key_down(0x56); time.sleep(0.02); key_up(0x56); key_up(0x11)
|
|
time.sleep(0.8)
|
|
press(0x0D)
|
|
time.sleep(2.5)
|
|
|
|
hwnd = None
|
|
def find_studio():
|
|
global hwnd
|
|
target = [None]
|
|
def cb(h, _):
|
|
l = user32.GetWindowTextLengthW(h)
|
|
if l > 0:
|
|
buf = ctypes.create_unicode_buffer(l + 1)
|
|
user32.GetWindowTextW(h, buf, l + 1)
|
|
if "Roblox Studio" in buf.value:
|
|
target[0] = h
|
|
return False
|
|
return True
|
|
WNDENUMPROC = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.wintypes.HWND, ctypes.wintypes.LPARAM)
|
|
user32.EnumWindows(WNDENUMPROC(cb), 0)
|
|
return target[0]
|
|
|
|
hwnd = find_studio()
|
|
if not hwnd:
|
|
print("Studio not found!"); sys.exit(1)
|
|
user32.ShowWindow(hwnd, 9); time.sleep(0.3)
|
|
user32.SetForegroundWindow(hwnd); time.sleep(0.3)
|
|
|
|
# ═══════ STEP 1: GTA City - Roads + Sidewalks ═══════
|
|
print("[1/6] GTA roads + sidewalks...")
|
|
paste_execute("""
|
|
-- Destroy old map parts, keep scripts
|
|
for _,v in pairs(workspace:GetChildren()) do
|
|
if v:IsA("Part") or v:IsA("Model") then
|
|
if v.Name~="Camera" and v.Name~="Terrain" and v.Name~="SpawnLocation" then
|
|
if v.Name:find("Building") or v.Name:find("Cover") or v.Name:find("Tower") or v.Name=="Ground" or v.Name:find("Boundary") then v:Destroy() end
|
|
end end end
|
|
wait(0.3)
|
|
-- New larger ground
|
|
local gnd=Instance.new("Part",workspace)gnd.Name="Ground"gnd.Size=Vector3.new(800,2,800)gnd.Position=Vector3.new(0,-1,0)gnd.Anchored=true gnd.BrickColor=BrickColor.new("Dark stone grey")gnd.Material=Enum.Material.Asphalt
|
|
-- Main roads (N-S and E-W)
|
|
local roadCol=BrickColor.new("Medium stone grey")
|
|
for _,r in ipairs({{0,0,800,20},{0,0,20,800}})do
|
|
local rd=Instance.new("Part",workspace)rd.Size=Vector3.new(r[3],0.5,r[4])rd.Position=Vector3.new(r[1],0.1,r[2])rd.Anchored=true rd.BrickColor=roadCol rd.Material=Enum.Material.SmoothPlastic rd.Name="Road"
|
|
end
|
|
-- Cross roads
|
|
for _,r in ipairs({{200,0,800,14},{-200,0,800,14},{0,200,14,800},{0,-200,14,800}})do
|
|
local rd=Instance.new("Part",workspace)rd.Size=Vector3.new(r[3],0.5,r[4])rd.Position=Vector3.new(r[1],0.1,r[2])rd.Anchored=true rd.BrickColor=roadCol rd.Material=Enum.Material.SmoothPlastic rd.Name="Road"
|
|
end
|
|
-- Road markings (yellow center lines)
|
|
for _,r in ipairs({{0,0,780,0.5},{0,0,0.5,780}})do
|
|
local ln=Instance.new("Part",workspace)ln.Size=Vector3.new(r[3],0.3,r[4])ln.Position=Vector3.new(r[1],0.35,r[2])ln.Anchored=true ln.BrickColor=BrickColor.new("Bright yellow")ln.Material=Enum.Material.Neon ln.Name="RoadLine"
|
|
end
|
|
-- Sidewalks along main roads
|
|
for _,s in ipairs({{12,0,800,8},{-12,0,800,8},{-12,0,8,800},{12,0,8,800}})do
|
|
local sw=Instance.new("Part",workspace)sw.Size=Vector3.new(s[3],0.8,s[4])sw.Position=Vector3.new(s[1],0.4,s[2])sw.Anchored=true sw.BrickColor=BrickColor.new("Brick yellow")sw.Material=Enum.Material.Pavement sw.Name="Sidewalk"
|
|
end
|
|
print("ROADS DONE")
|
|
""")
|
|
|
|
# ═══════ STEP 2: GTA City - Buildings with windows ═══════
|
|
print("[2/6] GTA buildings with windows...")
|
|
paste_execute("""
|
|
-- City buildings - various sizes and colors
|
|
local bData={
|
|
-- Downtown (center area)
|
|
{0,30,0,40,60,30,"Medium stone grey",true},
|
|
{-60,25,-50,30,50,25,"White",true},
|
|
{70,20,50,35,40,28,"Institutional white",true},
|
|
{-80,35,60,45,70,35,"Medium stone grey",true},
|
|
-- Commercial district
|
|
{-200,15,-80,30,30,25,"Reddish brown",false},
|
|
{-170,20,-30,28,40,22,"White",true},
|
|
{-230,18,60,32,36,28,"Medium stone grey",true},
|
|
{-180,22,120,26,44,20,"Brick yellow",false},
|
|
-- Residential
|
|
{200,12,-120,24,24,20,"Brick yellow",false},
|
|
{240,14,-60,22,28,18,"Brown",false},
|
|
{180,10,100,26,20,22,"Reddish brown",false},
|
|
{220,16,160,20,32,16,"White",false},
|
|
-- Industrial
|
|
{-300,18,-200,50,36,40,"Dark stone grey",false},
|
|
{-260,14,-150,40,28,35,"Medium stone grey",false},
|
|
{300,16,200,45,32,38,"Dark stone grey",false},
|
|
{280,12,260,38,24,30,"Dark stone grey",false},
|
|
-- Outskirts
|
|
{-350,10,-300,30,20,25,"Brown",false},
|
|
{350,8,300,28,16,22,"Brick yellow",false},
|
|
{-150,10,250,25,20,20,"Reddish brown",false},
|
|
{160,12,-250,22,24,18,"White",false},
|
|
}
|
|
for i,b in ipairs(bData)do
|
|
local m=Instance.new("Model",workspace)m.Name="CityBuilding"..i
|
|
-- Main structure
|
|
local p=Instance.new("Part",m)p.Name="Wall"p.Size=Vector3.new(b[4],b[5],b[6])p.Position=Vector3.new(b[1],b[2],b[3])p.Anchored=true p.BrickColor=BrickColor.new(b[7])p.Material=Enum.Material.Brick
|
|
-- Roof
|
|
local rf=Instance.new("Part",m)rf.Name="Roof"rf.Size=Vector3.new(b[4]+2,1,b[6]+2)rf.Position=Vector3.new(b[1],b[2]*2+0.5,b[3])rf.Anchored=true rf.BrickColor=BrickColor.new("Dark stone grey")rf.Material=Enum.Material.Metal
|
|
-- Windows (only for taller buildings)
|
|
if b[8]then
|
|
for floor=1,math.floor(b[5]/12)do
|
|
for wx=1,3 do
|
|
local win=Instance.new("Part",m)win.Name="Window_F"..floor.."_W"..wx
|
|
win.Size=Vector3.new(3,4,0.3)win.Position=Vector3.new(b[1]-b[4]/2+wx*b[4]/4,b[2]-b[5]/2+floor*12,b[3]+b[6]/2+0.2)
|
|
win.Anchored=true win.BrickColor=BrickColor.new("Pastel light blue")win.Material=Enum.Material.Glass win.Transparency=0.3
|
|
end
|
|
end
|
|
end
|
|
end
|
|
print("BUILDINGS DONE")
|
|
""")
|
|
|
|
# ═══════ STEP 3: GTA City - Street objects ═══════
|
|
print("[3/6] GTA street objects (lights, cars, props)...")
|
|
paste_execute("""
|
|
-- Street lights
|
|
for i=-350,350,50 do
|
|
for _,side in ipairs({1,-1})do
|
|
local pole=Instance.new("Part",workspace)pole.Name="StreetLight"pole.Size=Vector3.new(0.5,12,0.5)pole.Position=Vector3.new(i+side*15,6,side*15)pole.Anchored=true pole.BrickColor=BrickColor.new("Dark stone grey")pole.Material=Enum.Material.Metal
|
|
local bulb=Instance.new("Part",workspace)bulb.Name="LightBulb"bulb.Size=Vector3.new(2,1,2)bulb.Position=Vector3.new(i+side*15,12.5,side*15)bulb.Anchored=true bulb.BrickColor=BrickColor.new("New Yeller")bulb.Material=Enum.Material.Neon
|
|
local pl=Instance.new("PointLight",bulb)pl.Brightness=2 pl.Range=30 pl.Color=Color3.fromRGB(255,240,200)
|
|
end
|
|
end
|
|
-- Parked cars
|
|
local carColors={"Bright red","Bright blue","White","Black","Bright green","Bright yellow"}
|
|
for i=1,18 do
|
|
local cx,cz=math.random(-300,300),math.random(-300,300)
|
|
if math.abs(cx)<20 or math.abs(cz)<20 then cx=cx+30 end
|
|
local car=Instance.new("Model",workspace)car.Name="Car"..i
|
|
local body=Instance.new("Part",car)body.Name="Body"body.Size=Vector3.new(5,2,10)body.Position=Vector3.new(cx,1.5,cz)body.Anchored=true body.BrickColor=BrickColor.new(carColors[math.random(#carColors)])body.Material=Enum.Material.Plastic
|
|
local top=Instance.new("Part",car)top.Name="Roof"top.Size=Vector3.new(4,1.5,5)top.Position=Vector3.new(cx,3,cz-1)top.Anchored=true top.BrickColor=BrickColor.new("Glass")top.Material=Enum.Material.Glass top.Transparency=0.5
|
|
for _,wo in ipairs({{-2.5,0.8,-3},{2.5,0.8,-3},{-2.5,0.8,3},{2.5,0.8,3}})do
|
|
local wh=Instance.new("Part",car)wh.Name="Wheel"wh.Size=Vector3.new(1,2,2)wh.Position=Vector3.new(cx+wo[1],wo[2],cz+wo[3])wh.Anchored=true wh.BrickColor=BrickColor.new("Really black")wh.Material=Enum.Material.Slate
|
|
end
|
|
end
|
|
-- Traffic lights
|
|
for _,pos in ipairs({{20,0,20},{-20,0,-20},{20,0,-20},{-20,0,20}})do
|
|
local tl=Instance.new("Model",workspace)tl.Name="TrafficLight"
|
|
local pole=Instance.new("Part",tl)pole.Size=Vector3.new(0.5,10,0.5)pole.Position=Vector3.new(pos[1]+3,5,pos[3]+3)pole.Anchored=true pole.BrickColor=BrickColor.new("Dark stone grey")pole.Material=Enum.Material.Metal
|
|
local box=Instance.new("Part",tl)box.Size=Vector3.new(1,4,1)box.Position=Vector3.new(pos[1]+3,11,pos[3]+3)box.Anchored=true box.BrickColor=BrickColor.new("Dark stone grey")
|
|
local red=Instance.new("Part",tl)red.Size=Vector3.new(0.8,0.8,0.3)red.Position=Vector3.new(pos[1]+3,12.2,pos[3]+3.6)red.Anchored=true red.BrickColor=BrickColor.new("Bright red")red.Material=Enum.Material.Neon
|
|
local yel=Instance.new("Part",tl)yel.Size=Vector3.new(0.8,0.8,0.3)yel.Position=Vector3.new(pos[1]+3,11.2,pos[3]+3.6)yel.Anchored=true yel.BrickColor=BrickColor.new("Bright yellow")yel.Material=Enum.Material.Neon
|
|
local grn=Instance.new("Part",tl)grn.Size=Vector3.new(0.8,0.8,0.3)grn.Position=Vector3.new(pos[1]+3,10.2,pos[3]+3.6)grn.Anchored=true grn.BrickColor=BrickColor.new("Bright green")grn.Material=Enum.Material.Neon
|
|
end
|
|
-- Trees in park areas
|
|
for i=1,25 do
|
|
local tx,tz=math.random(-350,350),math.random(-350,350)
|
|
if math.abs(tx)<25 and math.abs(tz)<25 then tx=tx+40 end
|
|
local trunk=Instance.new("Part",workspace)trunk.Name="TreeTrunk"trunk.Size=Vector3.new(1,6,1)trunk.Position=Vector3.new(tx,3,tz)trunk.Anchored=true trunk.BrickColor=BrickColor.new("Brown")trunk.Material=Enum.Material.Wood
|
|
local leaves=Instance.new("Part",workspace)leaves.Name="TreeLeaves"leaves.Size=Vector3.new(6,5,6)leaves.Position=Vector3.new(tx,8,tz)leaves.Anchored=true leaves.BrickColor=BrickColor.new("Dark green")leaves.Material=Enum.Material.Grass leaves.Shape=Enum.PartType.Ball
|
|
end
|
|
-- Dumpsters, benches, phone booths
|
|
for i=1,12 do
|
|
local px,pz=math.random(-300,300),math.random(-300,300)
|
|
local prop=Instance.new("Part",workspace)prop.Name="Dumpster"..i
|
|
prop.Size=Vector3.new(5,3,3)prop.Position=Vector3.new(px,1.5,pz)prop.Anchored=true prop.BrickColor=BrickColor.new("Dark green")prop.Material=Enum.Material.Metal
|
|
end
|
|
-- Boundary walls
|
|
for _,w in ipairs({{0,10,0,800,20,2,0,400},{0,10,0,800,20,2,0,-400},{0,10,0,2,20,800,400,0},{0,10,0,2,20,800,-400,0}})do
|
|
local wall=Instance.new("Part",workspace)wall.Name="CityWall"wall.Size=Vector3.new(w[4],w[5],w[6])wall.Position=Vector3.new(w[7],w[2],w[8])wall.Anchored=true wall.BrickColor=BrickColor.new("Dark stone grey")wall.Material=Enum.Material.Concrete wall.Transparency=0.5
|
|
end
|
|
print("CITY PROPS DONE")
|
|
""")
|
|
|
|
# ═══════ STEP 4: Replace GameServer with human enemies ═══════
|
|
print("[4/6] Upgrading enemies to human models...")
|
|
paste_execute("""
|
|
-- Destroy old server script and enemies
|
|
for _,v in pairs(game.ServerScriptService:GetChildren())do v:Destroy()end
|
|
for _,v in pairs(workspace:GetChildren())do if v.Name=="EnemyBot"then v:Destroy()end end
|
|
wait(0.3)
|
|
local s=Instance.new("Script",game.ServerScriptService)s.Name="GameServer"
|
|
s.Source=[[
|
|
local RS=game.ReplicatedStorage local P=game.Players local D=game.Debris
|
|
local E=RS:WaitForChild("Events")local HE=E.HitEvent KE=E.KillEvent DE=E.DamageEvent HME=E.HitMarkerEvent
|
|
P.PlayerAdded:Connect(function(pl)
|
|
local ls=Instance.new("Folder",pl)ls.Name="leaderstats"
|
|
Instance.new("IntValue",ls).Name="Kills"
|
|
local k=ls.Kills k.Value=0
|
|
Instance.new("IntValue",ls).Name="Deaths"
|
|
pl.CharacterAdded:Connect(function(c)local h=c:WaitForChild("Humanoid")h.MaxHealth=100 h.Health=100 h.WalkSpeed=20
|
|
-- Attach visible weapon to player
|
|
task.delay(0.5,function()
|
|
if c and c:FindFirstChild("Right Arm")then
|
|
local gun=Instance.new("Part",c)gun.Name="GunModel"gun.Size=Vector3.new(0.4,0.4,2.5)gun.CanCollide=false gun.Anchored=false
|
|
gun.BrickColor=BrickColor.new("Dark stone grey")gun.Material=Enum.Material.Metal
|
|
local weld=Instance.new("Weld",gun)weld.Part0=c["Right Arm"]weld.Part1=gun
|
|
weld.C0=CFrame.new(0,-0.5,1.5)*CFrame.Angles(0,math.rad(90),0)
|
|
end
|
|
end)
|
|
h.Died:Connect(function()ls.Deaths.Value=ls.Deaths.Value+1 task.delay(4,function()if pl and pl.Parent then pl:LoadCharacter()end end)end)
|
|
end)end)
|
|
HE.OnServerEvent:Connect(function(pl,hp,dmg,hs)
|
|
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)
|
|
if hm.Health<=0 then KE:FireClient(pl,"Enemy")ls=pl.leaderstats ls.Kills.Value=ls.Kills.Value+1 end end end end)
|
|
-- Human-like enemy models
|
|
local skinTones={"Medium stone grey","Light stone grey","Pastel brown","Brick yellow","White","Brown"}
|
|
local shirtColors={"Bright red","Bright blue","White","Black","Bright green","Bright yellow","Dark green","Navy blue","Dark orange"}
|
|
local pantColors={"Dark stone grey","Black","Medium stone grey","Dark blue","Brown","Navy blue"}
|
|
local hairColors={"Black","Dark stone grey","Brown","Dark orange"}
|
|
local SP={Vector3.new(-300,3,-300),Vector3.new(300,3,-300),Vector3.new(-300,3,300),Vector3.new(300,3,300),Vector3.new(0,3,-350),Vector3.new(0,3,350),Vector3.new(-350,3,0),Vector3.new(350,3,0),Vector3.new(-200,3,-200),Vector3.new(200,3,200),Vector3.new(-100,3,100),Vector3.new(100,3,-100),Vector3.new(-250,3,150),Vector3.new(250,3,-150),Vector3.new(0,3,0)}
|
|
local function mkHuman(sp)
|
|
local skin=skinTones[math.random(#skinTones)]
|
|
local shirt=shirtColors[math.random(#shirtColors)]
|
|
local pants=pantColors[math.random(#pantsColors)]
|
|
local hair=hairColors[math.random(#hairColors)]
|
|
local m=Instance.new("Model",workspace)m.Name="EnemyBot"
|
|
-- Head
|
|
local hd=Instance.new("Part",m)hd.Name="Head"hd.Size=Vector3.new(2,2,1)hd.Position=sp+Vector3.new(0,8.5,0)hd.Anchored=false hd.BrickColor=BrickColor.new(skin)hd.Material=Enum.Material.Plastic
|
|
-- Face (eyes)
|
|
local eye1=Instance.new("Part",m)eye1.Name="Eye1"eye1.Size=Vector3.new(0.3,0.3,0.1)eye1.Position=sp+Vector3.new(-0.35,8.7,0.55)eye1.Anchored=false eye1.BrickColor=BrickColor.new("Really black")eye1.Material=Enum.Material.Plastic
|
|
local eye2=Instance.new("Part",m)eye2.Name="Eye2"eye2.Size=Vector3.new(0.3,0.3,0.1)eye2.Position=sp+Vector3.new(0.35,8.7,0.55)eye2.Anchored=false eye2.BrickColor=BrickColor.new("Really black")
|
|
-- Hair
|
|
local hr=Instance.new("Part",m)hr.Name="Hair"hr.Size=Vector3.new(2.1,0.8,1.1)hr.Position=sp+Vector3.new(0,9.7,0)hr.Anchored=false hr.BrickColor=BrickColor.new(hair)hr.Material=Enum.Material.Plastic
|
|
-- Torso
|
|
local ts=Instance.new("Part",m)ts.Name="Torso"ts.Size=Vector3.new(2,2,1)ts.Position=sp+Vector3.new(0,6.5,0)ts.Anchored=false ts.BrickColor=BrickColor.new(shirt)ts.Material=Enum.Material.Plastic
|
|
-- Arms
|
|
local la=Instance.new("Part",m)la.Name="Left Arm"la.Size=Vector3.new(1,2,1)la.Position=sp+Vector3.new(-1.5,6.5,0)la.Anchored=false la.BrickColor=BrickColor.new(skin)
|
|
local ra=Instance.new("Part",m)ra.Name="Right Arm"ra.Size=Vector3.new(1,2,1)ra.Position=sp+Vector3.new(1.5,6.5,0)ra.Anchored=false ra.BrickColor=BrickColor.new(skin)
|
|
-- Legs
|
|
local ll=Instance.new("Part",m)ll.Name="Left Leg"ll.Size=Vector3.new(1,2,1)ll.Position=sp+Vector3.new(-0.5,3.5,0)ll.Anchored=false ll.BrickColor=BrickColor.new(pants)
|
|
local rl=Instance.new("Part",m)rl.Name="Right Leg"rl.Size=Vector3.new(1,2,1)rl.Position=sp+Vector3.new(0.5,3.5,0)rl.Anchored=false rl.BrickColor=BrickColor.new(pants)
|
|
-- Enemy weapon
|
|
local gun=Instance.new("Part",m)gun.Name="GunModel"gun.Size=Vector3.new(0.3,0.3,2)gun.Position=sp+Vector3.new(2,6.5,1)gun.Anchored=false gun.CanCollide=false gun.BrickColor=BrickColor.new("Dark stone grey")gun.Material=Enum.Material.Metal
|
|
local hm=Instance.new("Humanoid",m)hm.MaxHealth=100 hm.Health=100 hm.WalkSpeed=14
|
|
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
|
|
-- Weld all parts
|
|
local function wld(p0,p1,c0)local w=Instance.new("Weld")w.Part0=p0 w.Part1=p1 w.C0=c0 or CFrame.new()w.Parent=p0 end
|
|
wld(rp,ts,CFrame.new(0,0,0))wld(ts,hd,CFrame.new(0,1.5,0))wld(ts,la,CFrame.new(-1.5,0.5,0))wld(ts,ra,CFrame.new(1.5,0.5,0))wld(ts,ll,CFrame.new(-0.5,-2,0))wld(ts,rl,CFrame.new(0.5,-2,0))
|
|
wld(ra,gun,CFrame.new(0,-0.3,1.5))
|
|
wld(hd,eye1,CFrame.new(-0.35,0.2,0.55))wld(hd,eye2,CFrame.new(0.35,0.2,0.55))wld(hd,hr,CFrame.new(0,1.2,0))
|
|
local tp=SP[math.random(#SP)]local ls=0
|
|
hm.Died:Connect(function()task.delay(5,function()if m.Parent then m:Destroy()end end)task.delay(12,function()mkHuman(SP[math.random(#SP)])end)end)
|
|
spawn(function()while m.Parent and hm.Health>0 do task.wait(.4)local r=m:FindFirstChild("HumanoidRootPart")if r then hm:MoveTo(tp)if(r.Position-tp).Magnitude<8 then tp=SP[math.random(#SP)]end end end end)
|
|
spawn(function()while m.Parent and hm.Health>0 do task.wait(.2)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<80 then hm:MoveTo(pr.Position)if d<55 and tick()-ls>1 then ls=tick()local ph=pl.Character:FindFirstChild("Humanoid")if ph and ph.Health>0 then ph:TakeDamage(5+math.random(10))DE:FireClient(pl,8)end end end end end end end)
|
|
end
|
|
for i=1,15 do task.delay(i*.3,function()mkHuman(SP[i])end)end
|
|
print("[GameServer] 15 human enemies spawned in GTA city!")
|
|
]]
|
|
print("ENEMIES DONE")
|
|
""")
|
|
|
|
# ═══════ STEP 5: Replace WeaponCtrl with gun model switching ═══════
|
|
print("[5/6] Weapon controller with visible guns...")
|
|
paste_execute("""
|
|
for _,v in pairs(game.StarterPlayer.StarterPlayerScripts:GetChildren())do v:Destroy()end
|
|
local ps=Instance.new("LocalScript",game.StarterPlayer.StarterPlayerScripts)ps.Name="PlayerSetup"
|
|
ps.Source=[[local P=game.Players local RS=game.RunService local UI=game.UserInputService local pl=P.LocalPlayer cam=workspace.CurrentCamera
|
|
pl.CharacterAdded:Connect(function(c)local h=c:WaitForChild("Humanoid")h.MaxHealth=100 h.Health=100 h.WalkSpeed=20
|
|
RS.RenderStepped:Connect(function()if h.Health>0 then cam.CameraType=Enum.CameraType.LockFirstPerson local hd=c:FindFirstChild("Head")if hd then cam.CFrame=hd.CFrame end end end)
|
|
local sp,cr=false,false
|
|
UI.InputBegan:Connect(function(i,g)if g then return end if i.KeyCode==Enum.KeyCode.LeftShift then sp=true h.WalkSpeed=30 elseif i.KeyCode==Enum.KeyCode.LeftControl then cr=true h.WalkSpeed=10 end end)
|
|
UI.InputEnded:Connect(function(i)if i.KeyCode==Enum.KeyCode.LeftShift then sp=false h.WalkSpeed=cr and 10 or 20 elseif i.KeyCode==Enum.KeyCode.LeftControl then cr=false h.WalkSpeed=sp and 30 or 20 end end)end)
|
|
]]
|
|
local wc=Instance.new("LocalScript",game.StarterPlayer.StarterPlayerScripts)wc.Name="WeaponCtrl"
|
|
wc.Source=[[
|
|
local P=game.Players local RS=game.RunService local UI=game.UserInputService local RepS=game.ReplicatedStorage local TS=game.TweenService local D=game.Debris
|
|
local pl=P.LocalPlayer cam=workspace.CurrentCamera ms=pl:GetMouse()
|
|
local E=RepS:WaitForChild("Events")local HE=E.HitEvent KE=E.KillEvent HME=E.HitMarkerEvent
|
|
local WD=require(RepS:WaitForChild("Shared"):WaitForChild("WeaponData"))
|
|
local ci=1 ammo={} isR=false isA=false canS=true ro=0 so=0 kills=0 holdM=false
|
|
for i,w in ipairs(WD)do ammo[i]=w.m end
|
|
local gunSizes={{0.4,0.4,2.5},{0.4,0.4,3},{0.4,0.5,3},{0.35,0.35,2.8},{0.3,0.3,1.8},{0.3,0.3,2},{0.3,0.3,4},{0.3,0.3,4.5},{0.4,0.4,2},{0.5,0.5,3.5}}
|
|
local gunColors={"Dark stone grey","Dark stone grey","Medium stone grey","Dark stone grey","Black","Black","Dark stone grey","Medium stone grey","Dark stone grey","Olive"}
|
|
local function updateGunModel()
|
|
local c=pl.Character if not c then return end
|
|
local old=c:FindFirstChild("GunModel")if old then old:Destroy()end
|
|
local arm=c:FindFirstChild("Right Arm")if not arm then return end
|
|
local gs=gunSizes[ci]or{0.4,0.4,2.5}
|
|
local gun=Instance.new("Part",c)gun.Name="GunModel"gun.Size=Vector3.new(gs[1],gs[2],gs[3])gun.CanCollide=false gun.Anchored=false
|
|
gun.BrickColor=BrickColor.new(gunColors[ci]or"Dark stone grey")gun.Material=Enum.Material.Metal
|
|
gun.CFrame=arm.CFrame*CFrame.new(0,-0.5,gs[3]/2+0.5)
|
|
local weld=Instance.new("Weld",gun)weld.Part0=arm weld.Part1=gun weld.C0=CFrame.new(0,-0.5,gs[3]/2+0.5)*CFrame.Angles(0,math.rad(90),0)
|
|
end
|
|
local function hud()return pl.PlayerGui:FindFirstChild("COD_HUD")end
|
|
local function sw(idx)if idx<1 or idx>#WD or isR then return end ci=idx local w=WD[ci]isA=false cam.FieldOfView=70 ro=0 so=0
|
|
local h=hud()if h then h.Ammo_Frame.AmmoTxt.Text=ammo[ci].." | "..w.m h.Ammo_Frame.WepName.Text=w.n end updateGunModel()end
|
|
UI.InputBegan:Connect(function(i,g)if g then return end
|
|
if i.KeyCode.Value>=48 and i.KeyCode.Value<=57 then local idx=i.KeyCode.Value-47 if idx>0 and idx<=10 then sw(idx==10 and 10 or idx)end end
|
|
if i.UserInputType==Enum.UserInputType.MouseButton2 then local w=WD[ci]if w.zm then isA=true cam.FieldOfView=70/w.zm else isA=true TS:Create(cam,TweenInfo.new(.15),{FieldOfView=50}):Play()end end
|
|
if i.KeyCode==Enum.KeyCode.R and not isR then local w=WD[ci]if ammo[ci]<w.m then isR=true canS=false local h=hud()if h then h.ReloadBar.Visible=true local f=h.ReloadBar.Fill f.Size=UDim2.new(0,0,1,0)TS:Create(f,TweenInfo.new(w.r),{Size=UDim2.new(1,0,1,0)}):Play()end task.delay(w.r,function()ammo[ci]=w.m isR=false canS=true local h=hud()if h then h.ReloadBar.Visible=false h.Ammo_Frame.AmmoTxt.Text=ammo[ci].." | "..w.m end end)end end end)
|
|
UI.InputEnded:Connect(function(i)if i.UserInputType==Enum.UserInputType.MouseButton2 then isA=false TS:Create(cam,TweenInfo.new(.15),{FieldOfView=70}):Play()end end)
|
|
local function shoot()
|
|
local w=WD[ci]if not canS or isR or ammo[ci]<=0 then return end ammo[ci]=ammo[ci]-1
|
|
local h=hud()if h then h.Ammo_Frame.AmmoTxt.Text=ammo[ci].." | "..w.m end
|
|
local c=pl.Character if not c or not c:FindFirstChild("Head")then return end
|
|
local hd=c.Head local sp=isA and w.a or w.s sp=sp+so
|
|
local dir=(ms.Hit.Position-hd.Position).Unit+Vector3.new((math.random()-.5)*sp,(math.random()-.5)*sp,(math.random()-.5)*sp).Unit
|
|
local rp=RaycastParams.new()rp.FilterType=Enum.RaycastFilterType.Exclude rp.FilterDescendantsInstances={c}
|
|
local pe=w.pel or 1
|
|
for p=1,pe do local d=dir if pe>1 then d=dir+Vector3.new((math.random()-.5)*w.s*2,(math.random()-.5)*w.s*2,(math.random()-.5)*w.s*2).Unit end
|
|
local r=workspace:Raycast(hd.Position,d*w.rng,rp)
|
|
if r then local hp=r.Instance local hs=hp.Name=="Head"
|
|
local tr=Instance.new("Part",workspace)tr.Size=Vector3.new(.1,.1,(r.Position-hd.Position).Magnitude)tr.CFrame=CFrame.lookAt(hd.Position,r.Position)*CFrame.new(0,0,-tr.Size.Z/2)tr.Anchored=true tr.CanCollide=false tr.BrickColor=BrickColor.new("New Yeller")tr.Material=Enum.Material.Neon tr.Transparency=.4 D:AddItem(tr,.12)
|
|
if w.expl then local ex=Instance.new("Explosion",workspace)ex.Position=r.Position ex.BlastRadius=w.bl or 25 ex.BlastPressure=500000 end
|
|
if hp.Parent and hp.Parent:FindFirstChild("Humanoid")then local hm=hp.Parent.Humanoid
|
|
if hm and hm.Health>0 then local dm=hs and w.d*w.h or w.d HE:FireServer(hp,dm,hs)
|
|
if hm.Health<=0 then kills=kills+1 local h=hud()if h then h.ScoreFrame.ScoreTxt.Text="KILLS: "..kills end KE:FireServer("Enemy")end end end end end
|
|
ro=math.min(ro+w.rc,w.rc*5)so=math.min(so+w.s*.5,w.s*3)
|
|
if ammo[ci]<=0 then task.delay(.2,function()if ammo[ci]<=0 and not isR then isR=true canS=false local ww=WD[ci]local h=hud()if h then h.ReloadBar.Visible=true local f=h.ReloadBar.Fill f.Size=UDim2.new(0,0,1,0)TS:Create(f,TweenInfo.new(ww.r),{Size=UDim2.new(1,0,1,0)}):Play()end task.delay(ww.r,function()ammo[ci]=ww.m isR=false canS=true local h=hud()if h then h.ReloadBar.Visible=false h.Ammo_Frame.AmmoTxt.Text=ammo[ci].." | "..ww.m end end)end end)end end
|
|
UI.InputBegan:Connect(function(i,g)if g then return end
|
|
if i.UserInputType==Enum.UserInputType.MouseButton1 then holdM=true local w=WD[ci]
|
|
if w.auto then spawn(function()while holdM and canS do shoot()task.wait(w.f)end end)else shoot()end end end)
|
|
UI.InputEnded:Connect(function(i)if i.UserInputType==Enum.UserInputType.MouseButton1 then holdM=false end end)
|
|
RS.RenderStepped:Connect(function()ro=math.max(ro-.12,0)so=math.max(so-.008,0)end)
|
|
pl.CharacterAdded:Connect(function()task.delay(1,updateGunModel)end)
|
|
sw(1)print("[WeaponCtrl] 10 COD weapons + visible guns loaded!")
|
|
]]
|
|
print("WEAPONS DONE")
|
|
""")
|
|
|
|
# ═══════ STEP 6: Press F5 ═══════
|
|
print("[6/6] Starting Play mode...")
|
|
time.sleep(1)
|
|
press(0x74)
|
|
|
|
print("\n" + "=" * 55)
|
|
print(" GTA CITY + COD WEAPONS + HUMAN ENEMIES")
|
|
print("=" * 55)
|
|
print(" City: 20 buildings, roads, cars, lights, trees")
|
|
print(" 15 human enemies with varied skin/clothes")
|
|
print(" 10 weapons with visible gun models")
|
|
print(" WASD=Move LMB=Shoot RMB=ADS R=Reload")
|
|
print(" Shift=Sprint Ctrl=Crouch")
|
|
print(" 1=M4A1 2=AK-47 3=SCAR-H 4=ACR 5=MP7")
|
|
print(" 6=MP5 7=AWP 8=Intervention 9=SPAS 0=RPG")
|
|
print("=" * 55)
|