1
This commit is contained in:
commit
a85391509d
211 files changed
+28903
No files matched your search
@@ -0,0 +1,312 @@
|
||||
--!strict
|
||||
-- Creates the reusable map-piece pool in ServerStorage once per place.
|
||||
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
|
||||
local old = ServerStorage:FindFirstChild("GameZonePrefabs")
|
||||
if old then old:Destroy() end
|
||||
local pool = Instance.new("Folder")
|
||||
pool.Name = "GameZonePrefabs"
|
||||
pool:SetAttribute("Ready", false)
|
||||
pool.Parent = ServerStorage
|
||||
|
||||
local function block(parent: Instance, name: string, size: Vector3, position: Vector3, color: Color3, material: Enum.Material): Part
|
||||
local p = Instance.new("Part")
|
||||
p.Name, p.Size, p.Position = name, size, position
|
||||
p.Anchored, p.CanCollide, p.Color, p.Material = true, true, color, material
|
||||
p.Parent = parent
|
||||
return p
|
||||
end
|
||||
|
||||
local function connector(parent: Model, name: string, position: Vector3, direction: Vector3)
|
||||
local a = Instance.new("Attachment")
|
||||
a.Name, a.Position, a.Axis = name, position, direction
|
||||
a:SetAttribute("Connector", true)
|
||||
a.Parent = parent.PrimaryPart
|
||||
end
|
||||
|
||||
local function prefab(name: string, size: Vector3, build: (Model, Part) -> ())
|
||||
local model = Instance.new("Model")
|
||||
model.Name = name
|
||||
model:SetAttribute("TileSize", size)
|
||||
local root = block(model, "Root", Vector3.new(1, 1, 1), Vector3.zero, Color3.new(1, 1, 1), Enum.Material.SmoothPlastic)
|
||||
root.Transparency, root.CanCollide = 1, false
|
||||
root:SetAttribute("PrefabRoot", true)
|
||||
model.PrimaryPart = root
|
||||
build(model, root)
|
||||
model.Parent = pool
|
||||
end
|
||||
|
||||
local road = Color3.fromRGB(48, 52, 58)
|
||||
local wall = Color3.fromRGB(178, 184, 220)
|
||||
local roof = Color3.fromRGB(115, 119, 154)
|
||||
local accent = Color3.fromRGB(255, 145, 91)
|
||||
local sidewalk = Color3.fromRGB(226, 202, 190)
|
||||
|
||||
local function gridTexture(part: BasePart, tile: number, color: Color3)
|
||||
local function face(normal: Vector3)
|
||||
local texture = Instance.new("Texture")
|
||||
texture.Name = "ConcreteGrid"
|
||||
texture.Texture = "rbxasset://textures/Studs.png"
|
||||
texture.Face = if normal == Vector3.yAxis then Enum.NormalId.Top
|
||||
elseif normal == -Vector3.yAxis then Enum.NormalId.Bottom
|
||||
elseif normal == Vector3.xAxis then Enum.NormalId.Right
|
||||
elseif normal == -Vector3.xAxis then Enum.NormalId.Left
|
||||
elseif normal == Vector3.zAxis then Enum.NormalId.Back else Enum.NormalId.Front
|
||||
texture.StudsPerTileU, texture.StudsPerTileV = tile, tile
|
||||
texture.Color3 = color
|
||||
texture.Transparency = 0.68
|
||||
texture.Parent = part
|
||||
end
|
||||
for _, axis in { Vector3.xAxis, -Vector3.xAxis, Vector3.yAxis, -Vector3.yAxis, Vector3.zAxis, -Vector3.zAxis } do face(axis) end
|
||||
end
|
||||
|
||||
local function inkEdges(parent: Instance, source: BasePart)
|
||||
local model = source:FindFirstAncestorOfClass("Model")
|
||||
if model then
|
||||
model:SetAttribute("PencilOutline", true)
|
||||
end
|
||||
end
|
||||
|
||||
local function wallPanel(parent: Instance, name: string, size: Vector3, position: Vector3)
|
||||
local panel = block(parent, name, size, position, wall, Enum.Material.Concrete)
|
||||
gridTexture(panel, 8, Color3.fromRGB(205, 209, 244))
|
||||
inkEdges(parent, panel)
|
||||
return panel
|
||||
end
|
||||
|
||||
prefab("RoadStraight", Vector3.new(40, 1, 40), function(m, root)
|
||||
local street = block(m, "Road", Vector3.new(40, 0.3, 20), Vector3.new(0, -0.35, 0), road, Enum.Material.Asphalt)
|
||||
inkEdges(m, street)
|
||||
block(m, "SidewalkA", Vector3.new(40, 0.2, 10), Vector3.new(0, -0.1, -15), sidewalk, Enum.Material.Concrete)
|
||||
block(m, "SidewalkB", Vector3.new(40, 0.2, 10), Vector3.new(0, -0.1, 15), sidewalk, Enum.Material.Concrete)
|
||||
block(m, "CurbA", Vector3.new(40, 0.2, 0.5), Vector3.new(0, -0.1, -10.25), Color3.fromRGB(173, 169, 184), Enum.Material.Concrete)
|
||||
block(m, "CurbB", Vector3.new(40, 0.2, 0.5), Vector3.new(0, -0.1, 10.25), Color3.fromRGB(173, 169, 184), Enum.Material.Concrete)
|
||||
for x = -15, 15, 10 do
|
||||
block(m, "PencilLaneDash", Vector3.new(4, 0.04, 0.3), Vector3.new(x, -0.18, 0), Color3.fromRGB(191, 190, 184), Enum.Material.SmoothPlastic)
|
||||
end
|
||||
connector(m, "West", Vector3.new(-20, 0, 0), Vector3.xAxis)
|
||||
connector(m, "East", Vector3.new(20, 0, 0), -Vector3.xAxis)
|
||||
end)
|
||||
|
||||
prefab("RoadIntersection", Vector3.new(40, 1, 40), function(m, root)
|
||||
local asphalt = block(m, "AsphaltBed", Vector3.new(39.8, 0.3, 39.8), Vector3.new(0, -0.35, 0), road, Enum.Material.Asphalt)
|
||||
inkEdges(m, asphalt)
|
||||
for _, x in {-14.5, 14.5} do
|
||||
for _, z in {-14.5, 14.5} do
|
||||
block(m, "CornerPavement", Vector3.new(11, 0.2, 11), Vector3.new(x, -0.1, z), sidewalk, Enum.Material.Concrete)
|
||||
end
|
||||
end
|
||||
for _, offset in {-14, 14} do
|
||||
for stripe = -2, 2 do
|
||||
block(m, "CrosswalkStripe", Vector3.new(0.65, 0.04, 1.4), Vector3.new(offset, -0.18, stripe * 2.1), Color3.fromRGB(210, 204, 195), Enum.Material.SmoothPlastic)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
prefab("Plaza", Vector3.new(40, 1, 40), function(m, root)
|
||||
block(m, "PlazaPaving", Vector3.new(39.8, 0.25, 39.8), Vector3.new(0, -0.15, 0), sidewalk, Enum.Material.Concrete)
|
||||
for _, x in {-15, 15} do
|
||||
for _, z in {-15, 15} do
|
||||
block(m, "LavenderInset", Vector3.new(8, 0.08, 8), Vector3.new(x, 0.02, z), Color3.fromRGB(190, 190, 218), Enum.Material.CeramicTiles)
|
||||
end
|
||||
end
|
||||
local basin = block(m, "FountainBasin", Vector3.new(11, 1.2, 11), Vector3.new(0, 0.55, 0), Color3.fromRGB(164, 177, 202), Enum.Material.Concrete)
|
||||
basin.Shape = Enum.PartType.Cylinder
|
||||
local water = block(m, "FountainWater", Vector3.new(8.5, 0.35, 8.5), Vector3.new(0, 1.28, 0), Color3.fromRGB(104, 205, 221), Enum.Material.Glass)
|
||||
water.Shape, water.Transparency = Enum.PartType.Cylinder, 0.18
|
||||
block(m, "FountainStem", Vector3.new(2, 5, 2), Vector3.new(0, 3.4, 0), Color3.fromRGB(190, 190, 218), Enum.Material.Concrete)
|
||||
local crown = block(m, "FountainCap", Vector3.new(4, 0.7, 4), Vector3.new(0, 6.1, 0), accent, Enum.Material.Slate)
|
||||
crown.Shape = Enum.PartType.Cylinder
|
||||
for _, x in {-12, 12} do
|
||||
for _, z in {-12, 12} do
|
||||
local lamp = block(m, "PlazaLantern", Vector3.new(0.8, 7, 0.8), Vector3.new(x, 3.5, z), Color3.fromRGB(58, 60, 78), Enum.Material.Metal)
|
||||
inkEdges(m, lamp)
|
||||
block(m, "LanternGlow", Vector3.new(2, 1.5, 2), Vector3.new(x, 7.3, z), Color3.fromRGB(255, 218, 145), Enum.Material.Neon)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
prefab("RoadCorner", Vector3.new(40, 1, 40), function(m, root)
|
||||
local roadX = block(m, "RoadX", Vector3.new(40, 0.3, 12), Vector3.new(0, -0.35, 0), road, Enum.Material.Asphalt)
|
||||
local roadZ = block(m, "RoadZ", Vector3.new(12, 0.3, 40), Vector3.new(0, -0.35, 0), road, Enum.Material.Asphalt)
|
||||
inkEdges(m, roadX)
|
||||
inkEdges(m, roadZ)
|
||||
connector(m, "North", Vector3.new(0, 0, -20), -Vector3.zAxis)
|
||||
connector(m, "East", Vector3.new(20, 0, 0), -Vector3.xAxis)
|
||||
end)
|
||||
|
||||
prefab("OpenLot", Vector3.new(40, 1, 40), function(m, root)
|
||||
block(m, "Paving", Vector3.new(39.8, 0.25, 39.8), Vector3.new(0, -0.22, 0), Color3.fromRGB(222, 202, 190), Enum.Material.Concrete)
|
||||
connector(m, "North", Vector3.new(0, 0, -20), -Vector3.zAxis)
|
||||
connector(m, "East", Vector3.new(20, 0, 0), -Vector3.xAxis)
|
||||
connector(m, "South", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
connector(m, "West", Vector3.new(-20, 0, 0), Vector3.xAxis)
|
||||
end)
|
||||
|
||||
prefab("Courtyard", Vector3.new(40, 1, 40), function(m, root)
|
||||
block(m, "Ground", Vector3.new(34, 0.5, 34), Vector3.new(0, 0.25, 0), Color3.fromRGB(216, 199, 183), Enum.Material.Concrete)
|
||||
for _, p in {{-14, -14}, {14, -14}, {-14, 14}, {14, 14}} do
|
||||
local pillar = wallPanel(m, "Pillar", Vector3.new(3, 8, 3), Vector3.new(p[1], 4, p[2]))
|
||||
gridTexture(pillar, 5, Color3.fromRGB(205, 209, 244))
|
||||
end
|
||||
connector(m, "South", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
connector(m, "West", Vector3.new(-20, 0, 0), Vector3.xAxis)
|
||||
end)
|
||||
|
||||
local function house(name: string, style: number)
|
||||
prefab(name, Vector3.new(40, 1, 40), function(m, root)
|
||||
local wallColor = if style == 1 then Color3.fromRGB(220, 207, 195) elseif style == 2 then Color3.fromRGB(199, 207, 229) else Color3.fromRGB(225, 190, 167)
|
||||
wallPanel(m, "RearFacadeLeft", Vector3.new(10, 16, 2), Vector3.new(-10, 8, -14)).Color = wallColor
|
||||
wallPanel(m, "RearFacadeRight", Vector3.new(10, 16, 2), Vector3.new(10, 8, -14)).Color = wallColor
|
||||
local left = wallPanel(m, "LeftFacade", Vector3.new(2, 16, 28), Vector3.new(-14, 8, 0))
|
||||
left.Color = wallColor
|
||||
local right = wallPanel(m, "RightFacade", Vector3.new(2, 16, 28), Vector3.new(14, 8, 0))
|
||||
right.Color = wallColor
|
||||
wallPanel(m, "FrontLeft", Vector3.new(10, 16, 2), Vector3.new(-10, 8, 14)).Color = wallColor
|
||||
wallPanel(m, "FrontRight", Vector3.new(10, 16, 2), Vector3.new(10, 8, 14)).Color = wallColor
|
||||
block(m, "InteriorFloor", Vector3.new(25, 0.3, 25), Vector3.new(0, -0.08, 0), Color3.fromRGB(218, 197, 183), Enum.Material.Concrete)
|
||||
local roofPart = block(m, "OverhangingRoof", Vector3.new(36, 1.2, 34), Vector3.new(0, 16.8, 0), roof, Enum.Material.Slate)
|
||||
inkEdges(m, roofPart)
|
||||
for _, panelData in {
|
||||
{"UpperRear", Vector3.new(22, 7, 1.2), Vector3.new(0, 20.9, -11.4)},
|
||||
{"UpperLeft", Vector3.new(1.2, 7, 18), Vector3.new(-10.4, 20.9, -2)},
|
||||
{"UpperRight", Vector3.new(1.2, 7, 18), Vector3.new(10.4, 20.9, -2)},
|
||||
{"UpperFrontLeft", Vector3.new(7, 7, 1.2), Vector3.new(-7.5, 20.9, 7.4)},
|
||||
{"UpperFrontRight", Vector3.new(7, 7, 1.2), Vector3.new(7.5, 20.9, 7.4)},
|
||||
} do
|
||||
local upperWall = wallPanel(m, panelData[1], panelData[2], panelData[3])
|
||||
upperWall.Color = wallColor
|
||||
end
|
||||
local topRoof = block(m, "UpperRoof", Vector3.new(26, 0.8, 24), Vector3.new(0, 24.8, -2), accent, Enum.Material.Slate)
|
||||
inkEdges(m, topRoof)
|
||||
for _, x in {-8, 8} do
|
||||
local window = block(m, "Window", Vector3.new(5, 4, 0.18), Vector3.new(x, 9, 14.96), Color3.fromRGB(151, 205, 220), Enum.Material.Glass)
|
||||
window.Transparency = 0.25
|
||||
inkEdges(m, window)
|
||||
block(m, "WindowSill", Vector3.new(6, 0.35, 0.5), Vector3.new(x, 6.8, 14.8), accent, Enum.Material.Wood)
|
||||
end
|
||||
local door = block(m, "Door", Vector3.new(5, 10, 0.3), Vector3.new(0, 5, 14.95), Color3.fromRGB(127, 78, 63), Enum.Material.Wood)
|
||||
door.CanCollide = false
|
||||
inkEdges(m, door)
|
||||
local porch = block(m, "Porch", Vector3.new(12, 0.6, 5), Vector3.new(0, 0.2, 17), Color3.fromRGB(221, 195, 178), Enum.Material.Concrete)
|
||||
inkEdges(m, porch)
|
||||
-- Exterior steps lead to the broad first roof; a second stair continues to the rooftop.
|
||||
for step = 0, 14 do
|
||||
block(m, "RoofAccessStep", Vector3.new(5.2, 1.1, 2.25), Vector3.new(17.2, 0.55 + step * 1.1, 14 - step * 2.1), accent, Enum.Material.Metal)
|
||||
end
|
||||
for step = 0, 6 do
|
||||
block(m, "UpperRoofStep", Vector3.new(2.2, 1.1, 2.25), Vector3.new(12.5, 17.95 + step * 1.1, 7 - step * 2.2), roof, Enum.Material.Metal)
|
||||
end
|
||||
connector(m, "North", Vector3.new(0, 0, -20), -Vector3.zAxis)
|
||||
connector(m, "South", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
end)
|
||||
end
|
||||
house("HouseWarm", 1)
|
||||
house("HouseBlue", 2)
|
||||
house("HouseTerracotta", 3)
|
||||
|
||||
prefab("Skybridge", Vector3.new(40, 1, 40), function(m, root)
|
||||
local deck = block(m, "BridgeDeck", Vector3.new(43, 0.8, 8), Vector3.new(0, 17.7, 0), Color3.fromRGB(178, 184, 220), Enum.Material.Concrete)
|
||||
inkEdges(m, deck)
|
||||
for _, z in {-4, 4} do
|
||||
block(m, "BridgeRail", Vector3.new(43, 2.2, 0.45), Vector3.new(0, 19.2, z), Color3.fromRGB(93, 95, 126), Enum.Material.Metal)
|
||||
end
|
||||
for _, x in {-15, 15} do
|
||||
block(m, "BridgeInkMark", Vector3.new(0.45, 0.04, 5.5), Vector3.new(x, 18.13, 0), accent, Enum.Material.SmoothPlastic)
|
||||
end
|
||||
end)
|
||||
|
||||
prefab("Tree", Vector3.new(40, 1, 40), function(m, root)
|
||||
local foliageRng = Random.new(DateTime.now().UnixTimestampMillis % 2147483647)
|
||||
local trunk = block(m, "Trunk", Vector3.new(2.5, 10, 2.5), Vector3.new(0, 5, 0), Color3.fromRGB(120, 83, 65), Enum.Material.Wood)
|
||||
inkEdges(m, trunk)
|
||||
for _, crown in {{0, 12, 0, 13}, {-4, 10, 2, 9}, {4, 11, -2, 10}, {1, 16, 1, 8}} do
|
||||
local foliage = Instance.new("Part")
|
||||
foliage.Name = "PaperLeafCanopy"
|
||||
foliage.Shape = Enum.PartType.Ball
|
||||
foliage.Size = Vector3.new(crown[4], crown[4] * 0.82, crown[4])
|
||||
foliage.Position = Vector3.new(crown[1], crown[2], crown[3])
|
||||
foliage.Anchored = true
|
||||
foliage.CanCollide = true
|
||||
foliage.Color = Color3.fromRGB(foliageRng:NextInteger(123, 158), 157, 137)
|
||||
foliage.Material = Enum.Material.SmoothPlastic
|
||||
foliage.Parent = m
|
||||
inkEdges(m, foliage)
|
||||
end
|
||||
block(m, "Planter", Vector3.new(10, 1, 10), Vector3.new(0, 0.1, 0), Color3.fromRGB(186, 170, 160), Enum.Material.Concrete)
|
||||
end)
|
||||
|
||||
prefab("StreetLamp", Vector3.new(40, 1, 40), function(m, root)
|
||||
local post = block(m, "LampPost", Vector3.new(0.7, 12, 0.7), Vector3.new(0, 6, 0), Color3.fromRGB(58, 60, 78), Enum.Material.Metal)
|
||||
inkEdges(m, post)
|
||||
local arm = block(m, "LampArm", Vector3.new(4, 0.6, 0.6), Vector3.new(1.6, 11.7, 0), Color3.fromRGB(58, 60, 78), Enum.Material.Metal)
|
||||
inkEdges(m, arm)
|
||||
local lamp = block(m, "WarmLamp", Vector3.new(2, 0.5, 1.5), Vector3.new(2.8, 11.2, 0), Color3.fromRGB(255, 218, 145), Enum.Material.Neon)
|
||||
inkEdges(m, lamp)
|
||||
end)
|
||||
|
||||
prefab("RoofRamp", Vector3.new(40, 1, 40), function(m, root)
|
||||
local slope = Instance.new("WedgePart")
|
||||
slope.Name = "RoofAccessRamp"
|
||||
slope.Size = Vector3.new(12, 18, 34)
|
||||
slope.CFrame = CFrame.new(0, 9, 0) * CFrame.Angles(0, math.rad(90), 0)
|
||||
slope.Anchored = true
|
||||
slope.Color = accent
|
||||
slope.Material = Enum.Material.Metal
|
||||
slope.Parent = m
|
||||
block(m, "LowerLanding", Vector3.new(14, 0.6, 8), Vector3.new(0, 0.3, 16), Color3.fromRGB(221, 195, 178), Enum.Material.Concrete)
|
||||
block(m, "UpperLanding", Vector3.new(14, 0.6, 8), Vector3.new(0, 9.3, -16), roof, Enum.Material.Slate)
|
||||
connector(m, "Lower", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
connector(m, "Upper", Vector3.new(0, 9, -20), -Vector3.zAxis)
|
||||
end)
|
||||
|
||||
prefab("Barricade", Vector3.new(40, 1, 40), function(m, root)
|
||||
local body = block(m, "ConcreteBlock", Vector3.new(13, 5, 4), Vector3.new(0, 2.5, 0), Color3.fromRGB(221, 139, 104), Enum.Material.Concrete)
|
||||
gridTexture(body, 6, Color3.fromRGB(255, 204, 157))
|
||||
inkEdges(m, body)
|
||||
for x = -4, 4, 4 do
|
||||
block(m, "PaintStripe", Vector3.new(1.2, 5.1, 4.1), Vector3.new(x, 2.5, 0), Color3.fromRGB(244, 211, 172), Enum.Material.SmoothPlastic)
|
||||
end
|
||||
connector(m, "West", Vector3.new(-20, 0, 0), Vector3.xAxis)
|
||||
connector(m, "East", Vector3.new(20, 0, 0), -Vector3.xAxis)
|
||||
end)
|
||||
|
||||
prefab("Building", Vector3.new(40, 1, 40), function(m, root)
|
||||
wallPanel(m, "BuildingLeft", Vector3.new(14, 14, 28), Vector3.new(-13, 7, 0))
|
||||
wallPanel(m, "BuildingRight", Vector3.new(14, 14, 28), Vector3.new(13, 7, 0))
|
||||
wallPanel(m, "RearWall", Vector3.new(28, 14, 2), Vector3.new(0, 7, -14))
|
||||
wallPanel(m, "FrontLeft", Vector3.new(9, 14, 2), Vector3.new(-9.5, 7, 14))
|
||||
wallPanel(m, "FrontRight", Vector3.new(9, 14, 2), Vector3.new(9.5, 7, 14))
|
||||
block(m, "Roof", Vector3.new(34, 1, 30), Vector3.new(0, 14.5, 0), roof, Enum.Material.Metal)
|
||||
block(m, "PassageFloor", Vector3.new(10, 0.5, 28), Vector3.new(0, 0.25, 0), Color3.fromRGB(221, 195, 178), Enum.Material.Concrete)
|
||||
block(m, "OrangeCover", Vector3.new(9, 12, 7), Vector3.new(0, 6, 3), accent, Enum.Material.SmoothPlastic)
|
||||
connector(m, "North", Vector3.new(0, 0, -20), -Vector3.zAxis)
|
||||
connector(m, "South", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
end)
|
||||
|
||||
prefab("Alley", Vector3.new(40, 1, 40), function(m, root)
|
||||
block(m, "AlleyFloor", Vector3.new(14, 0.4, 40), Vector3.new(0, 0, 0), Color3.fromRGB(225, 199, 181), Enum.Material.Concrete)
|
||||
wallPanel(m, "WestWall", Vector3.new(2, 16, 40), Vector3.new(-18, 8, 0))
|
||||
wallPanel(m, "EastWall", Vector3.new(2, 16, 40), Vector3.new(18, 8, 0))
|
||||
local orangeBlock = block(m, "OrangeBlock", Vector3.new(7, 10, 7), Vector3.new(-5, 5, -5), accent, Enum.Material.SmoothPlastic)
|
||||
gridTexture(orangeBlock, 6, Color3.fromRGB(255, 204, 157))
|
||||
inkEdges(m, orangeBlock)
|
||||
block(m, "LowDetour", Vector3.new(4, 3, 10), Vector3.new(5, 1.5, 8), roof, Enum.Material.Metal)
|
||||
connector(m, "North", Vector3.new(0, 0, -20), -Vector3.zAxis)
|
||||
connector(m, "South", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
end)
|
||||
|
||||
prefab("Ramp", Vector3.new(40, 1, 40), function(m, root)
|
||||
local ramp = Instance.new("WedgePart")
|
||||
ramp.Name, ramp.Size, ramp.Position = "Ramp", Vector3.new(12, 10, 30), Vector3.new(0, 5, 0)
|
||||
ramp.Anchored, ramp.Color, ramp.Material, ramp.Parent = true, accent, Enum.Material.Metal, m
|
||||
block(m, "Landing", Vector3.new(18, 1, 10), Vector3.new(0, 10, -13), roof, Enum.Material.Metal)
|
||||
connector(m, "South", Vector3.new(0, 0, 20), Vector3.zAxis)
|
||||
connector(m, "North", Vector3.new(0, 10, -20), -Vector3.zAxis)
|
||||
end)
|
||||
|
||||
pool:SetAttribute("PrefabCount", #pool:GetChildren())
|
||||
|
||||
pool:SetAttribute("Ready", true)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
--!strict
|
||||
-- Script in ServerScriptService.
|
||||
-- Spawns players immediately in the Hunter lobby without equipping a weapon.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
Players.CharacterAutoLoads = true
|
||||
|
||||
local lobby = workspace:WaitForChild("HunterLobby")
|
||||
local lobbySpawn = lobby:WaitForChild("Arrival Spawn") :: SpawnLocation
|
||||
|
||||
local function onCharacterAdded(player: Player, character: Model)
|
||||
task.defer(function()
|
||||
task.wait(0.2)
|
||||
if character.Parent then
|
||||
character:PivotTo(lobbySpawn.CFrame + Vector3.new(0, 4, 0))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function onPlayerAdded(player: Player)
|
||||
player.CharacterAdded:Connect(function(character)
|
||||
onCharacterAdded(player, character)
|
||||
end)
|
||||
if player.Character then
|
||||
onCharacterAdded(player, player.Character)
|
||||
end
|
||||
end
|
||||
|
||||
Players.PlayerAdded:Connect(onPlayerAdded)
|
||||
for _, player in Players:GetPlayers() do
|
||||
onPlayerAdded(player)
|
||||
end
|
||||
@@ -0,0 +1,54 @@
|
||||
--!strict
|
||||
-- Lobby gateways send a player into the current server's generated GameZone.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local Workspace = game:GetService("Workspace")
|
||||
|
||||
local lobby = Workspace:WaitForChild("HunterLobby")
|
||||
local zone = Workspace:WaitForChild("GameZone")
|
||||
while zone:GetAttribute("Ready") ~= true do
|
||||
task.wait()
|
||||
end
|
||||
|
||||
local destination = Vector3.new(0, 4, -180)
|
||||
local cooldown: { [Player]: boolean } = {}
|
||||
|
||||
local function teleport(hit: BasePart)
|
||||
local character = hit:FindFirstAncestorOfClass("Model")
|
||||
local player = character and Players:GetPlayerFromCharacter(character)
|
||||
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
|
||||
if not player or not character or not humanoid or cooldown[player] then
|
||||
return
|
||||
end
|
||||
cooldown[player] = true
|
||||
character:PivotTo(CFrame.new(destination))
|
||||
local backpack = player:FindFirstChildOfClass("Backpack")
|
||||
local tool = backpack and backpack:FindFirstChild("SniperRifle")
|
||||
if tool and tool:IsA("Tool") then
|
||||
humanoid:EquipTool(tool)
|
||||
end
|
||||
task.delay(1.5, function()
|
||||
cooldown[player] = nil
|
||||
end)
|
||||
end
|
||||
|
||||
for _, name in { "Arena Gateway_001", "Training Gateway_001", "Duel Gateway_001" } do
|
||||
local gateway = lobby:WaitForChild(name)
|
||||
local cf, size = gateway:GetBoundingBox()
|
||||
local trigger = Instance.new("Part")
|
||||
trigger.Name = name .. " Teleport Trigger"
|
||||
trigger.Size = Vector3.new(math.min(size.X - 4, 18), 5, math.min(size.Z - 4, 18))
|
||||
trigger.CFrame = CFrame.new(cf.Position.X, 2.5, cf.Position.Z)
|
||||
trigger.Transparency = 1
|
||||
trigger.Anchored = true
|
||||
trigger.CanCollide = false
|
||||
trigger.CanTouch = true
|
||||
trigger.Parent = gateway
|
||||
trigger.Touched:Connect(teleport)
|
||||
end
|
||||
|
||||
Players.PlayerRemoving:Connect(function(player)
|
||||
cooldown[player] = nil
|
||||
end)
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
--!strict
|
||||
-- Builds a seeded 520x520 arena from connected 40-stud city modules.
|
||||
|
||||
local Workspace = game:GetService("Workspace")
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
local SIZE = 520
|
||||
local GRID_RADIUS = 6
|
||||
local STEP = 40
|
||||
local CENTER = Vector3.new(0, 0, -420)
|
||||
local rng = Random.new(DateTime.now().UnixTimestampMillis % 2147483647)
|
||||
local pool = ServerStorage:WaitForChild("GameZonePrefabs")
|
||||
while pool:GetAttribute("Ready") ~= true do
|
||||
task.wait()
|
||||
end
|
||||
|
||||
local old = Workspace:FindFirstChild("GameZone")
|
||||
if old then old:Destroy() end
|
||||
local zone = Instance.new("Folder")
|
||||
zone.Name = "GameZone"
|
||||
zone:SetAttribute("Size", SIZE)
|
||||
zone:SetAttribute("GridCells", GRID_RADIUS * 2 + 1)
|
||||
zone:SetAttribute("Seed", rng:NextInteger(1, 2147483646))
|
||||
zone:SetAttribute("Ready", false)
|
||||
zone.Parent = Workspace
|
||||
|
||||
local function block(name: string, size: Vector3, position: Vector3, color: Color3, material: Enum.Material): Part
|
||||
local p = Instance.new("Part")
|
||||
p.Name, p.Size, p.Position = name, size, position
|
||||
p.Anchored, p.CanCollide, p.Color, p.Material = true, true, color, material
|
||||
p.Parent = zone
|
||||
return p
|
||||
end
|
||||
|
||||
local function cloneAt(kind: string, name: string, position: Vector3, yaw: number?): Model?
|
||||
local source = pool:FindFirstChild(kind)
|
||||
if not source or not source:IsA("Model") then return nil end
|
||||
local model = source:Clone()
|
||||
model.Name = name
|
||||
model:PivotTo(CFrame.new(position) * CFrame.Angles(0, yaw or 0, 0))
|
||||
for _, item in model:GetDescendants() do
|
||||
if item:IsA("BasePart") and item:GetAttribute("PrefabRoot") then item:Destroy() end
|
||||
end
|
||||
model.Parent = zone
|
||||
return model
|
||||
end
|
||||
|
||||
local function addInkOutline(model: Model)
|
||||
for _, source in model:GetDescendants() do
|
||||
if source:IsA("BasePart") and source.Name ~= "Root" and source.Size.Magnitude >= 12 then
|
||||
local outline = Instance.new("Part")
|
||||
outline.Name = "PencilEdge"
|
||||
outline.Size = source.Size + Vector3.new(0.08, 0.08, 0.08)
|
||||
outline.CFrame = source.CFrame
|
||||
outline.Anchored, outline.CanCollide, outline.CanQuery, outline.CanTouch = true, false, false, false
|
||||
outline.Transparency = 1
|
||||
outline.Parent = model
|
||||
local box = Instance.new("SelectionBox")
|
||||
box.Name, box.Adornee = "PencilLine", outline
|
||||
box.Color3, box.LineThickness, box.SurfaceTransparency = Color3.fromRGB(48, 47, 67), 0.012, 1
|
||||
box.Parent = model
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local edge = SIZE / 2
|
||||
local boundary = Color3.fromRGB(86, 91, 99)
|
||||
block("North Skyline Wall", Vector3.new(SIZE, 42, 4), CENTER + Vector3.new(0, 21, -edge), boundary, Enum.Material.Concrete)
|
||||
block("West Skyline Wall", Vector3.new(4, 42, SIZE), CENTER + Vector3.new(-edge, 21, 0), boundary, Enum.Material.Concrete)
|
||||
block("East Skyline Wall", Vector3.new(4, 42, SIZE), CENTER + Vector3.new(edge, 21, 0), boundary, Enum.Material.Concrete)
|
||||
-- Keep the south boulevard open as the one clear portal entrance.
|
||||
block("South Skyline West", Vector3.new(edge - 24, 42, 4), CENTER + Vector3.new(-edge / 2 - 12, 21, edge), boundary, Enum.Material.Concrete)
|
||||
block("South Skyline East", Vector3.new(edge - 24, 42, 4), CENTER + Vector3.new(edge / 2 + 12, 21, edge), boundary, Enum.Material.Concrete)
|
||||
|
||||
local function onMainStreet(value: number): boolean
|
||||
return value == -3 or value == 0 or value == 3
|
||||
end
|
||||
|
||||
local houseKinds = { "HouseWarm", "HouseBlue", "HouseTerracotta" }
|
||||
local lotKinds = { "House", "House", "House", "Courtyard", "Alley", "OpenLot" }
|
||||
local roadCells = 0
|
||||
local houseCount = 0
|
||||
local bridgeCells: { [number]: { [number]: boolean } } = { [-3] = { [-1] = true }, [3] = { [1] = true } }
|
||||
|
||||
for row = -GRID_RADIUS, GRID_RADIUS do
|
||||
for col = -GRID_RADIUS, GRID_RADIUS do
|
||||
local isStreet = onMainStreet(row) or onMainStreet(col)
|
||||
local position = CENTER + Vector3.new(col * STEP, 0, row * STEP)
|
||||
if isStreet then
|
||||
roadCells += 1
|
||||
if row == 0 and col == 0 then
|
||||
cloneAt("Plaza", "Central Fountain Plaza", position)
|
||||
elseif onMainStreet(row) and onMainStreet(col) then
|
||||
cloneAt("RoadIntersection", ("Intersection_%d_%d"):format(row, col), position)
|
||||
else
|
||||
local vertical = onMainStreet(col)
|
||||
local yaw = if vertical then math.rad(90) else 0
|
||||
local bridgeRow = bridgeCells[col]
|
||||
if bridgeRow and bridgeRow[row] then
|
||||
local bridge = cloneAt("Skybridge", ("RooftopBridge_%d_%d"):format(row, col), position)
|
||||
if bridge then bridge:PivotTo(CFrame.new(position + Vector3.new(0, 17.7, 0))) end
|
||||
end
|
||||
cloneAt("RoadStraight", ("Street_%d_%d"):format(row, col), position, yaw)
|
||||
end
|
||||
else
|
||||
-- A connected street grid surrounds compact blocks; controlled variation keeps every server's districts distinct.
|
||||
block(("DistrictPaving_%d_%d"):format(row, col), Vector3.new(39.7, 0.2, 39.7), position + Vector3.new(0, -0.25, 0), Color3.fromRGB(222, 202, 190), Enum.Material.Concrete)
|
||||
local pick = rng:NextInteger(1, #lotKinds)
|
||||
local lotType = lotKinds[pick]
|
||||
local kind = if lotType == "House" then houseKinds[rng:NextInteger(1, #houseKinds)] else lotType
|
||||
if math.abs(row) == 5 or math.abs(col) == 5 then
|
||||
kind = if rng:NextNumber() < 0.72 then houseKinds[rng:NextInteger(1, #houseKinds)] else "Courtyard"
|
||||
end
|
||||
local yaw = if kind == "Alley" and rng:NextNumber() < 0.5 then math.rad(90) else 0
|
||||
local tile = cloneAt(kind, ("Block_%s_%d_%d"):format(kind, row, col), position, yaw)
|
||||
if tile then
|
||||
tile:SetAttribute("GridX", col)
|
||||
tile:SetAttribute("GridZ", row)
|
||||
tile:SetAttribute("TileKind", kind)
|
||||
if kind:match("^House") then
|
||||
houseCount += 1
|
||||
addInkOutline(tile)
|
||||
end
|
||||
end
|
||||
if kind == "Courtyard" or kind == "OpenLot" then
|
||||
for _, offset in { {-14, -14}, {14, -14}, {-14, 14}, {14, 14} } do
|
||||
if rng:NextNumber() < 0.72 then
|
||||
local propName = if rng:NextNumber() < 0.72 then "Tree" else "StreetLamp"
|
||||
cloneAt(propName, ("%s_%d_%d_%d"):format(propName, row, col, rng:NextInteger(1, 99)), position + Vector3.new(offset[1], 0, offset[2]))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
task.wait()
|
||||
end
|
||||
|
||||
-- Entry arch frames the south boulevard and stays clear of the portal's landing point.
|
||||
local archBase = CENTER + Vector3.new(0, 0, edge - 24)
|
||||
block("Entry Arch Left", Vector3.new(5, 24, 7), archBase + Vector3.new(-19, 12, 0), Color3.fromRGB(178, 184, 220), Enum.Material.Concrete)
|
||||
block("Entry Arch Right", Vector3.new(5, 24, 7), archBase + Vector3.new(19, 12, 0), Color3.fromRGB(178, 184, 220), Enum.Material.Concrete)
|
||||
block("Entry Arch Header", Vector3.new(43, 5, 8), archBase + Vector3.new(0, 25, 0), Color3.fromRGB(178, 184, 220), Enum.Material.Concrete)
|
||||
block("Entry Arch Ink", Vector3.new(45, 0.25, 0.35), archBase + Vector3.new(0, 27.7, 4.1), Color3.fromRGB(48, 47, 67), Enum.Material.SmoothPlastic)
|
||||
|
||||
local botSpawns = Workspace:FindFirstChild("BotSpawns")
|
||||
local spawnCells = { {0, -5}, {0, -2}, {0, 2}, {0, 5}, {-5, 0}, {5, 0}, {-3, 2}, {3, -2} }
|
||||
if botSpawns and botSpawns:IsA("Folder") then
|
||||
for index, marker in botSpawns:GetChildren() do
|
||||
if marker:IsA("BasePart") then
|
||||
local cell = spawnCells[((index - 1) % #spawnCells) + 1]
|
||||
marker.CFrame = CFrame.new(CENTER + Vector3.new(cell[1] * STEP, 2, cell[2] * STEP))
|
||||
marker:SetAttribute("Zone", "Game")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
zone:SetAttribute("RoadCells", roadCells)
|
||||
zone:SetAttribute("HouseCount", houseCount)
|
||||
zone:SetAttribute("Ready", true)
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
--!strict
|
||||
-- Script in ServerScriptService.
|
||||
-- Target bots: a copy of ServerStorage.TargetBot stands on every part in Workspace.BotSpawns
|
||||
-- (move / add / remove those parts to place them; each bot faces where its part faces).
|
||||
-- They do nothing but stand and take bullets (SniperShots deals the damage to models tagged
|
||||
-- "TargetBot"); a dead bot falls apart and a new one stands up on the same spot after RESPAWN_TIME.
|
||||
|
||||
local CollectionService = game:GetService("CollectionService")
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
|
||||
local TAG = "TargetBot"
|
||||
local RESPAWN_TIME = 4
|
||||
local template = ServerStorage:WaitForChild("TargetBot") :: Model
|
||||
local gameZone = workspace:WaitForChild("GameZone")
|
||||
while gameZone:GetAttribute("Ready") ~= true do task.wait() end
|
||||
local spawns = workspace:WaitForChild("BotSpawns")
|
||||
|
||||
local botsFolder = Instance.new("Folder")
|
||||
botsFolder.Name = "TargetBots"
|
||||
botsFolder.Parent = workspace
|
||||
|
||||
local function spawnBot(marker: BasePart)
|
||||
local bot = template:Clone()
|
||||
local root = bot:FindFirstChild("HumanoidRootPart") :: BasePart
|
||||
local humanoid = bot:FindFirstChildOfClass("Humanoid") :: Humanoid
|
||||
-- feet on the marker: the root sits half its height plus the hip height above the ground
|
||||
local lift = root.Size.Y / 2 + humanoid.HipHeight
|
||||
bot:PivotTo(marker.CFrame * CFrame.new(0, lift - marker.Size.Y / 2, 0))
|
||||
root.Anchored = true -- stands still, cannot be pushed over
|
||||
bot.Name = "Bot_" .. marker.Name
|
||||
CollectionService:AddTag(bot, TAG)
|
||||
bot.Parent = botsFolder
|
||||
humanoid.Died:Once(function()
|
||||
root.Anchored = false -- let the body fall
|
||||
task.delay(RESPAWN_TIME, function()
|
||||
bot:Destroy()
|
||||
if marker.Parent then
|
||||
spawnBot(marker)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
for _, marker in spawns:GetChildren() do
|
||||
if marker:IsA("BasePart") then
|
||||
spawnBot(marker)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"content":[{"type":"text","text":"{\"botChanges\":[{\"before\":[1740.495361328125,7.560688495635986,239.5489044189453,-0.880471408367157,-0.0002455839712638408,0.4740999937057495,-0.00013392482651397586,1.0000003576278687,0.00026928301667794585,-0.4740998446941376,0.00017360225319862366,-0.8804711103439331],\"name\":\"BotSpawn3\",\"after\":[1740.495361328125,8.060686111450196,239.5490264892578,-0.880471408367157,-0.0002455839712638408,0.4740999937057495,-0.00013392482651397586,1.0000003576278687,0.00026928301667794585,-0.4740998446941376,0.00017360225319862366,-0.8804711103439331]},{\"before\":[1730.495361328125,7.565176486968994,199.5489044189453,-0.9981689453125,-0.0002455839712638408,0.060495052486658099,-0.00023463212710339576,1.0000003576278687,0.0001881408243207261,-0.060495078563690189,0.00017360225319862366,-0.9981684684753418],\"name\":\"BotSpawn5\",\"after\":[1730.495361328125,8.065174102783204,199.5489959716797,-0.9981689453125,-0.0002455839712638408,0.060495052486658099,-0.00023463212710339576,1.0000003576278687,0.0001881408243207261,-0.060495078563690189,0.00017360225319862366,-0.9981684684753418]},{\"before\":[1705.495361328125,7.557301044464111,209.5489044189453,-0.9363296031951904,-0.00024558400036767125,-0.3511236011981964,-0.0002909032627940178,1.0000004768371583,0.00007631848711753264,0.3511234521865845,0.00017360226775053889,-0.9363292455673218],\"name\":\"BotSpawn4\",\"after\":[1705.495361328125,8.05729866027832,209.5489959716797,-0.9363296031951904,-0.00024558400036767125,-0.3511236011981964,-0.0002909032627940178,1.0000004768371583,0.00007631848711753264,0.3511234521865845,0.00017360226775053889,-0.9363292455673218]},{\"before\":[1750.495361328125,7.569220542907715,204.5489044189453,-0.9305663108825684,-0.0002455839712638408,0.36612439155578616,-0.00016497210890520364,1.0000003576278687,0.00025146250845864415,-0.36612430214881899,0.00017360225319862366,-0.9305659532546997],\"name\":\"BotSpawn6\",\"after\":[1750.495361328125,8.069217681884766,204.5489959716797,-0.9305663108825684,-0.0002455839712638408,0.36612439155578616,-0.00016497210890520364,1.0000003576278687,0.00025146250845864415,-0.36612430214881899,0.00017360225319862366,-0.9305659532546997]},{\"before\":[1715.495361328125,7.568437099456787,159.5489044189453,-0.9946590662002564,-0.00024558400036767125,-0.10321935266256333,-0.000262191315414384,1.0000004768371583,0.0001473258889745921,0.10321928560733795,0.00017360226775053889,-0.9946585893630981],\"name\":\"BotSpawn7\",\"after\":[1715.495361328125,8.068434715270996,159.54896545410157,-0.9946590662002564,-0.00024558400036767125,-0.10321935266256333,-0.000262191315414384,1.0000004768371583,0.0001473258889745921,0.10321928560733795,0.00017360226775053889,-0.9946585893630981]},{\"before\":[1726.495361328125,7.5581183433532719,234.5489044189453,-1,-0.0002455839712638408,0,-0.0002455839712638408,1,0.0001736021658871323,0,0.00017360225319862366,-1],\"name\":\"BotSpawn2\",\"after\":[1726.495361328125,8.05811595916748,234.5490264892578,-1,-0.0002455839712638408,0,-0.0002455839712638408,1,0.0001736021658871323,0,0.00017360225319862366,-1]},{\"before\":[1712.495361328125,7.553812026977539,239.5489044189453,-0.880471408367157,-0.0002455839712638408,-0.4741000533103943,-0.0002985343453474343,1.0000003576278687,0.00003642036608653143,0.4740998446941376,0.00017360225319862366,-0.8804711103439331],\"name\":\"BotSpawn1\",\"after\":[1712.495361328125,8.053810119628907,239.5490264892578,-0.880471408367157,-0.0002455839712638408,-0.4741000533103943,-0.0002985343453474343,1.0000003576278687,0.00003642036608653143,0.4740998446941376,0.00017360225319862366,-0.8804711103439331]},{\"before\":[25,0.10000000149011612,-120,-0.9868499636650086,0,0.16163921356201173,0,1.0000001192092896,-0,-0.16163921356201173,0,-0.9868499636650086],\"name\":\"BotSpawn8\",\"after\":[1712.0001220703126,8.075840950012207,-200.00009155273438,-0.9868499636650086,0,0.16163921356201173,0,1.0000001192092896,0,-0.16163921356201173,0,-0.9868499636650086]}],\"spawns\":12}"}],"isError":false}
|
||||
Reference in new issue
Block a user