Loading model...
by Σ Furios Σ · 3/30/2026
Lua Script
| 1 | -- Generated with StudForge.org | AI-powered 3D models for Roblox |
| 2 | -- Model: TreasureChest |
| 3 | |
| 4 | -- Generated with StudForge.org | AI-powered 3D models for Roblox |
| 5 | -- Model: TreasureChest |
| 6 | |
| 7 | local MS = game:GetService("MaterialService") |
| 8 | |
| 9 | local ok, roots = pcall(game.GetObjects, game, "rbxassetid://13386676607") |
| 10 | if not ok then return warn(roots) end |
| 11 | |
| 12 | local tmp = Instance.new("Folder") |
| 13 | for _, r in ipairs(roots) do r.Parent = tmp end |
| 14 | |
| 15 | for _, d in ipairs(tmp:GetDescendants()) do |
| 16 | if d:IsA("MaterialVariant") then |
| 17 | d.Parent = MS |
| 18 | end |
| 19 | end |
| 20 | tmp:Destroy() |
| 21 | |
| 22 | local model = Instance.new("Model") |
| 23 | model.Name = "TreasureChest" |
| 24 | model.Parent = workspace |
| 25 | |
| 26 | local variants = { |
| 27 | ["Bright yellow"] = "2022 Big Stud", |
| 28 | ["Deep orange"] = "2022 Stud", |
| 29 | ["Really black"] = "2022 Universal", |
| 30 | ["Reddish brown"] = "2022 Small Stud", |
| 31 | } |
| 32 | do |
| 33 | local p = Instance.new("Part") |
| 34 | p.Name = "BaseWood" |
| 35 | p.Size = Vector3.new(11.5, 5, 7.5) |
| 36 | p.CFrame = CFrame.new(0, 2.5, 0) |
| 37 | p.BrickColor = BrickColor.new("Reddish brown") |
| 38 | p.Material = Enum.Material.Glacier |
| 39 | p.MaterialVariant = "2022 Small Stud" |
| 40 | p.Anchored = true |
| 41 | p.Parent = model |
| 42 | end |
| 43 | do |
| 44 | local p = Instance.new("Part") |
| 45 | p.Name = "TrimBottomFront" |
| 46 | p.Size = Vector3.new(12, 0.6, 0.6) |
| 47 | p.CFrame = CFrame.new(0, 0.26, -4) |
| 48 | p.BrickColor = BrickColor.new("Deep orange") |
| 49 | p.Material = Enum.Material.Glacier |
| 50 | p.MaterialVariant = "2022 Stud" |
| 51 | p.Anchored = true |
| 52 | p.Parent = model |
| 53 | end |
| 54 | do |
| 55 | local p = Instance.new("Part") |
| 56 | p.Name = "TrimBottomBack" |
| 57 | p.Size = Vector3.new(12, 0.6, 0.6) |
| 58 | p.CFrame = CFrame.new(0, 0.26, 4) |
| 59 | p.BrickColor = BrickColor.new("Deep orange") |
| 60 | p.Material = Enum.Material.Glacier |
| 61 | p.MaterialVariant = "2022 Stud" |
| 62 | p.Anchored = true |
| 63 | p.Parent = model |
| 64 | end |
| 65 | do |
| 66 | local p = Instance.new("Part") |
| 67 | p.Name = "TrimBottomLeft" |
| 68 | p.Size = Vector3.new(0.6, 0.6, 8) |
| 69 | p.CFrame = CFrame.new(-6, 0.18, 0) |
| 70 | p.BrickColor = BrickColor.new("Deep orange") |
| 71 | p.Material = Enum.Material.Glacier |
| 72 | p.MaterialVariant = "2022 Stud" |
| 73 | p.Anchored = true |
| 74 | p.Parent = model |
| 75 | end |
| 76 | do |
| 77 | local p = Instance.new("Part") |
| 78 | p.Name = "TrimBottomRight" |
| 79 | p.Size = Vector3.new(0.6, 0.6, 8) |
| 80 | p.CFrame = CFrame.new(6, 0.18, 0) |
| 81 | p.BrickColor = BrickColor.new("Deep orange") |
| 82 | p.Material = Enum.Material.Glacier |
| 83 | p.MaterialVariant = "2022 Stud" |
| 84 | p.Anchored = true |
| 85 | p.Parent = model |
| 86 | end |
| 87 | do |
| 88 | local p = Instance.new("Part") |
| 89 | p.Name = "TrimTopFront" |
| 90 | p.Size = Vector3.new(12, 0.6, 0.6) |
| 91 | p.CFrame = CFrame.new(0, 4.74, -4) |
| 92 | p.BrickColor = BrickColor.new("Bright yellow") |
| 93 | p.Material = Enum.Material.Glacier |
| 94 | p.MaterialVariant = "2022 Big Stud" |
| 95 | p.Anchored = true |
| 96 | p.Parent = model |
| 97 | end |
| 98 | do |
| 99 | local p = Instance.new("Part") |
| 100 | p.Name = "TrimTopBack" |
| 101 | p.Size = Vector3.new(12, 0.6, 0.6) |
| 102 | p.CFrame = CFrame.new(0, 4.74, 4) |
| 103 | p.BrickColor = BrickColor.new("Bright yellow") |
| 104 | p.Material = Enum.Material.Glacier |
| 105 | p.MaterialVariant = "2022 Big Stud" |
| 106 | p.Anchored = true |
| 107 | p.Parent = model |
| 108 | end |
| 109 | do |
| 110 | local p = Instance.new("Part") |
| 111 | p.Name = "TrimTopLeft" |
| 112 | p.Size = Vector3.new(0.6, 0.6, 8) |
| 113 | p.CFrame = CFrame.new(-6.08, 4.62, 0) |
| 114 | p.BrickColor = BrickColor.new("Bright yellow") |
| 115 | p.Material = Enum.Material.Glacier |
| 116 | p.MaterialVariant = "2022 Big Stud" |
| 117 | p.Anchored = true |
| 118 | p.Parent = model |
| 119 | end |
| 120 | do |
| 121 | local p = Instance.new("Part") |
| 122 | p.Name = "TrimTopRight" |
| 123 | p.Size = Vector3.new(0.6, 0.6, 8) |
| 124 | p.CFrame = CFrame.new(6.08, 4.62, 0) |
| 125 | p.BrickColor = BrickColor.new("Bright yellow") |
| 126 | p.Material = Enum.Material.Glacier |
| 127 | p.MaterialVariant = "2022 Big Stud" |
| 128 | p.Anchored = true |
| 129 | p.Parent = model |
| 130 | end |
| 131 | do |
| 132 | local p = Instance.new("Part") |
| 133 | p.Name = "PillarFL" |
| 134 | p.Size = Vector3.new(0.6, 5, 0.6) |
| 135 | p.CFrame = CFrame.new(-5.96, 2.58, -3.92) |
| 136 | p.BrickColor = BrickColor.new("Deep orange") |
| 137 | p.Material = Enum.Material.Glacier |
| 138 | p.MaterialVariant = "2022 Stud" |
| 139 | p.Anchored = true |
| 140 | p.Parent = model |
| 141 | end |
| 142 | do |
| 143 | local p = Instance.new("Part") |
| 144 | p.Name = "PillarFR" |
| 145 | p.Size = Vector3.new(0.6, 5, 0.6) |
| 146 | p.CFrame = CFrame.new(5.96, 2.58, -3.92) |
| 147 | p.BrickColor = BrickColor.new("Deep orange") |
| 148 | p.Material = Enum.Material.Glacier |
| 149 | p.MaterialVariant = "2022 Stud" |
| 150 | p.Anchored = true |
| 151 | p.Parent = model |
| 152 | end |
| 153 | do |
| 154 | local p = Instance.new("Part") |
| 155 | p.Name = "PillarBL" |
| 156 | p.Size = Vector3.new(0.6, 5, 0.6) |
| 157 | p.CFrame = CFrame.new(-5.96, 2.34, 4.08) |
| 158 | p.BrickColor = BrickColor.new("Deep orange") |
| 159 | p.Material = Enum.Material.Glacier |
| 160 | p.MaterialVariant = "2022 Stud" |
| 161 | p.Anchored = true |
| 162 | p.Parent = model |
| 163 | end |
| 164 | do |
| 165 | local p = Instance.new("Part") |
| 166 | p.Name = "PillarBR" |
| 167 | p.Size = Vector3.new(0.6, 5, 0.6) |
| 168 | p.CFrame = CFrame.new(5.96, 2.34, 4.08) |
| 169 | p.BrickColor = BrickColor.new("Deep orange") |
| 170 | p.Material = Enum.Material.Glacier |
| 171 | p.MaterialVariant = "2022 Stud" |
| 172 | p.Anchored = true |
| 173 | p.Parent = model |
| 174 | end |
| 175 | do |
| 176 | local p = Instance.new("Part") |
| 177 | p.Name = "LidWoodCore" |
| 178 | p.Size = Vector3.new(11.5, 4, 7.5) |
| 179 | p.CFrame = CFrame.new(0, 7.04, 0) |
| 180 | p.BrickColor = BrickColor.new("Reddish brown") |
| 181 | p.Material = Enum.Material.Glacier |
| 182 | p.MaterialVariant = "2022 Small Stud" |
| 183 | p.Anchored = true |
| 184 | p.Parent = model |
| 185 | end |
| 186 | do |
| 187 | local p = Instance.new("Part") |
| 188 | p.Shape = Enum.PartType.Cylinder |
| 189 | p.Name = "LidWoodTop" |
| 190 | p.Size = Vector3.new(11.5, 7.5, 7.5) |
| 191 | p.CFrame = CFrame.new(0, 9, 0) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(90)) |
| 192 | p.BrickColor = BrickColor.new("Reddish brown") |
| 193 | p.Material = Enum.Material.Glacier |
| 194 | p.MaterialVariant = "2022 Small Stud" |
| 195 | p.Anchored = true |
| 196 | p.Parent = model |
| 197 | end |
| 198 | do |
| 199 | local p = Instance.new("Part") |
| 200 | p.Name = "LidStrap1" |
| 201 | p.Size = Vector3.new(0.6, 0.2, 8) |
| 202 | p.CFrame = CFrame.new(-2.96, 9, 0) |
| 203 | p.BrickColor = BrickColor.new("Bright yellow") |
| 204 | p.Material = Enum.Material.Glacier |
| 205 | p.MaterialVariant = "2022 Big Stud" |
| 206 | p.Anchored = true |
| 207 | p.Parent = model |
| 208 | end |
| 209 | do |
| 210 | local p = Instance.new("Part") |
| 211 | p.Name = "LidStrap2" |
| 212 | p.Size = Vector3.new(0.6, 0.2, 8) |
| 213 | p.CFrame = CFrame.new(3.04, 9, 0) |
| 214 | p.BrickColor = BrickColor.new("Bright yellow") |
| 215 | p.Material = Enum.Material.Glacier |
| 216 | p.MaterialVariant = "2022 Big Stud" |
| 217 | p.Anchored = true |
| 218 | p.Parent = model |
| 219 | end |
| 220 | do |
| 221 | local p = Instance.new("Part") |
| 222 | p.Shape = Enum.PartType.Cylinder |
| 223 | p.Name = "LockPlate" |
| 224 | p.Size = Vector3.new(0.2, 2.5, 2.5) |
| 225 | p.CFrame = CFrame.new(0, 5, -4.24) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 226 | p.BrickColor = BrickColor.new("Bright yellow") |
| 227 | p.Material = Enum.Material.Glacier |
| 228 | p.MaterialVariant = "2022 Big Stud" |
| 229 | p.Anchored = true |
| 230 | p.Parent = model |
| 231 | end |
| 232 | do |
| 233 | local p = Instance.new("Part") |
| 234 | p.Shape = Enum.PartType.Cylinder |
| 235 | p.Name = "KeyholeTop" |
| 236 | p.Size = Vector3.new(0.1, 0.6, 0.6) |
| 237 | p.CFrame = CFrame.new(0, 5.3, -4.46) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 238 | p.BrickColor = BrickColor.new("Really black") |
| 239 | p.Material = Enum.Material.Glacier |
| 240 | p.MaterialVariant = "2022 Universal" |
| 241 | p.Anchored = true |
| 242 | p.Parent = model |
| 243 | end |
| 244 | do |
| 245 | local p = Instance.new("Part") |
| 246 | p.Name = "KeyholeBottom" |
| 247 | p.Size = Vector3.new(0.6, 0.8, 0.1) |
| 248 | p.CFrame = CFrame.new(0, 4.7, -4.42) |
| 249 | p.BrickColor = BrickColor.new("Really black") |
| 250 | p.Material = Enum.Material.Glacier |
| 251 | p.MaterialVariant = "2022 Universal" |
| 252 | p.Anchored = true |
| 253 | p.Parent = model |
| 254 | end |
| 255 | do |
| 256 | local p = Instance.new("Part") |
| 257 | p.Name = "PlankGap1" |
| 258 | p.Size = Vector3.new(11, 0.1, 0.2) |
| 259 | p.CFrame = CFrame.new(0, 1.65, -4.05) |
| 260 | p.BrickColor = BrickColor.new("Really black") |
| 261 | p.Material = Enum.Material.Glacier |
| 262 | p.MaterialVariant = "2022 Universal" |
| 263 | p.Anchored = true |
| 264 | p.Parent = model |
| 265 | end |
| 266 | do |
| 267 | local p = Instance.new("Part") |
| 268 | p.Name = "PlankGap2" |
| 269 | p.Size = Vector3.new(11, 0.1, 0.2) |
| 270 | p.CFrame = CFrame.new(0, 3.3, -4.05) |
| 271 | p.BrickColor = BrickColor.new("Really black") |
| 272 | p.Material = Enum.Material.Glacier |
| 273 | p.MaterialVariant = "2022 Universal" |
| 274 | p.Anchored = true |
| 275 | p.Parent = model |
| 276 | end |
| 277 | do |
| 278 | local rightV = Vector3.new(0,0,1).Unit |
| 279 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 280 | local normalV = upV:Cross(rightV) |
| 281 | local pos = Vector3.new(-6, 5.08, 0) |
| 282 | local cyl = Instance.new("Part") |
| 283 | cyl.Shape = Enum.PartType.Cylinder |
| 284 | cyl.Size = Vector3.new(0.6, 8, 8) |
| 285 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 286 | cyl.BrickColor = BrickColor.new("Bright yellow") |
| 287 | cyl.Material = Enum.Material.Glacier |
| 288 | cyl.MaterialVariant = "2022 Big Stud" |
| 289 | cyl.Anchored = true; cyl.Parent = workspace |
| 290 | local cuts = {} |
| 291 | local hole = Instance.new("Part") |
| 292 | hole.Shape = Enum.PartType.Cylinder |
| 293 | hole.Size = Vector3.new(0.8, 6.8, 6.8) |
| 294 | hole.CFrame = cyl.CFrame |
| 295 | hole.BrickColor = BrickColor.new("Bright yellow") |
| 296 | hole.Material = Enum.Material.Glacier |
| 297 | hole.MaterialVariant = "2022 Big Stud" |
| 298 | hole.Anchored = true; hole.Parent = workspace |
| 299 | table.insert(cuts, hole) |
| 300 | local angBoxes = {} |
| 301 | do |
| 302 | local edgeDir = 1*rightV + 0*upV |
| 303 | local edgePerp = 0*rightV + 1*upV |
| 304 | local cut = Instance.new("Part") |
| 305 | cut.Size = Vector3.new(16, 0.8, 16) |
| 306 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 8 * edgePerp, edgeDir, normalV) |
| 307 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 308 | cut.Material = Enum.Material.Glacier |
| 309 | cut.MaterialVariant = "2022 Big Stud" |
| 310 | cut.Anchored = true; cut.Parent = workspace |
| 311 | table.insert(angBoxes, cut) |
| 312 | end |
| 313 | do |
| 314 | local edgeDir = -1*rightV + 0*upV |
| 315 | local edgePerp = 0*rightV + -1*upV |
| 316 | local cut = Instance.new("Part") |
| 317 | cut.Size = Vector3.new(16, 0.8, 16) |
| 318 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 8 * edgePerp, edgeDir, normalV) |
| 319 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 320 | cut.Material = Enum.Material.Glacier |
| 321 | cut.MaterialVariant = "2022 Big Stud" |
| 322 | cut.Anchored = true; cut.Parent = workspace |
| 323 | table.insert(angBoxes, cut) |
| 324 | end |
| 325 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 326 | if #cuts > 0 then |
| 327 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 328 | for _, c in ipairs(cuts) do c:Destroy() end |
| 329 | if ok and result then |
| 330 | cyl:Destroy() |
| 331 | result.Name = "LidArchL"; result.Anchored = true; result.Parent = model |
| 332 | else |
| 333 | cyl.Name = "LidArchL"; cyl.Parent = model |
| 334 | end |
| 335 | else |
| 336 | cyl.Name = "LidArchL"; cyl.Parent = model |
| 337 | end |
| 338 | end |
| 339 | do |
| 340 | local rightV = Vector3.new(0,0,1).Unit |
| 341 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 342 | local normalV = upV:Cross(rightV) |
| 343 | local pos = Vector3.new(6, 5.08, 0) |
| 344 | local cyl = Instance.new("Part") |
| 345 | cyl.Shape = Enum.PartType.Cylinder |
| 346 | cyl.Size = Vector3.new(0.6, 8, 8) |
| 347 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 348 | cyl.BrickColor = BrickColor.new("Bright yellow") |
| 349 | cyl.Material = Enum.Material.Glacier |
| 350 | cyl.MaterialVariant = "2022 Big Stud" |
| 351 | cyl.Anchored = true; cyl.Parent = workspace |
| 352 | local cuts = {} |
| 353 | local hole = Instance.new("Part") |
| 354 | hole.Shape = Enum.PartType.Cylinder |
| 355 | hole.Size = Vector3.new(0.8, 6.8, 6.8) |
| 356 | hole.CFrame = cyl.CFrame |
| 357 | hole.BrickColor = BrickColor.new("Bright yellow") |
| 358 | hole.Material = Enum.Material.Glacier |
| 359 | hole.MaterialVariant = "2022 Big Stud" |
| 360 | hole.Anchored = true; hole.Parent = workspace |
| 361 | table.insert(cuts, hole) |
| 362 | local angBoxes = {} |
| 363 | do |
| 364 | local edgeDir = 1*rightV + 0*upV |
| 365 | local edgePerp = 0*rightV + 1*upV |
| 366 | local cut = Instance.new("Part") |
| 367 | cut.Size = Vector3.new(16, 0.8, 16) |
| 368 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 8 * edgePerp, edgeDir, normalV) |
| 369 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 370 | cut.Material = Enum.Material.Glacier |
| 371 | cut.MaterialVariant = "2022 Big Stud" |
| 372 | cut.Anchored = true; cut.Parent = workspace |
| 373 | table.insert(angBoxes, cut) |
| 374 | end |
| 375 | do |
| 376 | local edgeDir = -1*rightV + 0*upV |
| 377 | local edgePerp = 0*rightV + -1*upV |
| 378 | local cut = Instance.new("Part") |
| 379 | cut.Size = Vector3.new(16, 0.8, 16) |
| 380 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 8 * edgePerp, edgeDir, normalV) |
| 381 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 382 | cut.Material = Enum.Material.Glacier |
| 383 | cut.MaterialVariant = "2022 Big Stud" |
| 384 | cut.Anchored = true; cut.Parent = workspace |
| 385 | table.insert(angBoxes, cut) |
| 386 | end |
| 387 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 388 | if #cuts > 0 then |
| 389 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 390 | for _, c in ipairs(cuts) do c:Destroy() end |
| 391 | if ok and result then |
| 392 | cyl:Destroy() |
| 393 | result.Name = "LidArchR"; result.Anchored = true; result.Parent = model |
| 394 | else |
| 395 | cyl.Name = "LidArchR"; cyl.Parent = model |
| 396 | end |
| 397 | else |
| 398 | cyl.Name = "LidArchR"; cyl.Parent = model |
| 399 | end |
| 400 | end |
| 401 | do |
| 402 | local rightV = Vector3.new(0,0,1).Unit |
| 403 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 404 | local normalV = upV:Cross(rightV) |
| 405 | local pos = Vector3.new(-3, 5.08, 0) |
| 406 | local cyl = Instance.new("Part") |
| 407 | cyl.Shape = Enum.PartType.Cylinder |
| 408 | cyl.Size = Vector3.new(0.6, 8.4, 8.4) |
| 409 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 410 | cyl.BrickColor = BrickColor.new("Bright yellow") |
| 411 | cyl.Material = Enum.Material.Glacier |
| 412 | cyl.MaterialVariant = "2022 Big Stud" |
| 413 | cyl.Anchored = true; cyl.Parent = workspace |
| 414 | local cuts = {} |
| 415 | local hole = Instance.new("Part") |
| 416 | hole.Shape = Enum.PartType.Cylinder |
| 417 | hole.Size = Vector3.new(0.8, 8, 8) |
| 418 | hole.CFrame = cyl.CFrame |
| 419 | hole.BrickColor = BrickColor.new("Bright yellow") |
| 420 | hole.Material = Enum.Material.Glacier |
| 421 | hole.MaterialVariant = "2022 Big Stud" |
| 422 | hole.Anchored = true; hole.Parent = workspace |
| 423 | table.insert(cuts, hole) |
| 424 | local angBoxes = {} |
| 425 | do |
| 426 | local edgeDir = 1*rightV + 0*upV |
| 427 | local edgePerp = 0*rightV + 1*upV |
| 428 | local cut = Instance.new("Part") |
| 429 | cut.Size = Vector3.new(16.8, 0.8, 16.8) |
| 430 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 8.4 * edgePerp, edgeDir, normalV) |
| 431 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 432 | cut.Material = Enum.Material.Glacier |
| 433 | cut.MaterialVariant = "2022 Big Stud" |
| 434 | cut.Anchored = true; cut.Parent = workspace |
| 435 | table.insert(angBoxes, cut) |
| 436 | end |
| 437 | do |
| 438 | local edgeDir = -1*rightV + 0*upV |
| 439 | local edgePerp = 0*rightV + -1*upV |
| 440 | local cut = Instance.new("Part") |
| 441 | cut.Size = Vector3.new(16.8, 0.8, 16.8) |
| 442 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 8.4 * edgePerp, edgeDir, normalV) |
| 443 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 444 | cut.Material = Enum.Material.Glacier |
| 445 | cut.MaterialVariant = "2022 Big Stud" |
| 446 | cut.Anchored = true; cut.Parent = workspace |
| 447 | table.insert(angBoxes, cut) |
| 448 | end |
| 449 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 450 | if #cuts > 0 then |
| 451 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 452 | for _, c in ipairs(cuts) do c:Destroy() end |
| 453 | if ok and result then |
| 454 | cyl:Destroy() |
| 455 | result.Name = "LidStrapArc1"; result.Anchored = true; result.Parent = model |
| 456 | else |
| 457 | cyl.Name = "LidStrapArc1"; cyl.Parent = model |
| 458 | end |
| 459 | else |
| 460 | cyl.Name = "LidStrapArc1"; cyl.Parent = model |
| 461 | end |
| 462 | end |
| 463 | do |
| 464 | local rightV = Vector3.new(0,0,1).Unit |
| 465 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 466 | local normalV = upV:Cross(rightV) |
| 467 | local pos = Vector3.new(3, 5.08, 0) |
| 468 | local cyl = Instance.new("Part") |
| 469 | cyl.Shape = Enum.PartType.Cylinder |
| 470 | cyl.Size = Vector3.new(0.6, 8.4, 8.4) |
| 471 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 472 | cyl.BrickColor = BrickColor.new("Bright yellow") |
| 473 | cyl.Material = Enum.Material.Glacier |
| 474 | cyl.MaterialVariant = "2022 Big Stud" |
| 475 | cyl.Anchored = true; cyl.Parent = workspace |
| 476 | local cuts = {} |
| 477 | local hole = Instance.new("Part") |
| 478 | hole.Shape = Enum.PartType.Cylinder |
| 479 | hole.Size = Vector3.new(0.8, 8, 8) |
| 480 | hole.CFrame = cyl.CFrame |
| 481 | hole.BrickColor = BrickColor.new("Bright yellow") |
| 482 | hole.Material = Enum.Material.Glacier |
| 483 | hole.MaterialVariant = "2022 Big Stud" |
| 484 | hole.Anchored = true; hole.Parent = workspace |
| 485 | table.insert(cuts, hole) |
| 486 | local angBoxes = {} |
| 487 | do |
| 488 | local edgeDir = 1*rightV + 0*upV |
| 489 | local edgePerp = 0*rightV + 1*upV |
| 490 | local cut = Instance.new("Part") |
| 491 | cut.Size = Vector3.new(16.8, 0.8, 16.8) |
| 492 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 8.4 * edgePerp, edgeDir, normalV) |
| 493 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 494 | cut.Material = Enum.Material.Glacier |
| 495 | cut.MaterialVariant = "2022 Big Stud" |
| 496 | cut.Anchored = true; cut.Parent = workspace |
| 497 | table.insert(angBoxes, cut) |
| 498 | end |
| 499 | do |
| 500 | local edgeDir = -1*rightV + 0*upV |
| 501 | local edgePerp = 0*rightV + -1*upV |
| 502 | local cut = Instance.new("Part") |
| 503 | cut.Size = Vector3.new(16.8, 0.8, 16.8) |
| 504 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 8.4 * edgePerp, edgeDir, normalV) |
| 505 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 506 | cut.Material = Enum.Material.Glacier |
| 507 | cut.MaterialVariant = "2022 Big Stud" |
| 508 | cut.Anchored = true; cut.Parent = workspace |
| 509 | table.insert(angBoxes, cut) |
| 510 | end |
| 511 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 512 | if #cuts > 0 then |
| 513 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 514 | for _, c in ipairs(cuts) do c:Destroy() end |
| 515 | if ok and result then |
| 516 | cyl:Destroy() |
| 517 | result.Name = "LidStrapArc2"; result.Anchored = true; result.Parent = model |
| 518 | else |
| 519 | cyl.Name = "LidStrapArc2"; cyl.Parent = model |
| 520 | end |
| 521 | else |
| 522 | cyl.Name = "LidStrapArc2"; cyl.Parent = model |
| 523 | end |
| 524 | end |
| 525 | do |
| 526 | local upV = Vector3.new(0,1,0).Unit |
| 527 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 528 | local forwardV = rightV:Cross(upV) |
| 529 | local pos = Vector3.new(-6, -0.08, -4) |
| 530 | local ball = Instance.new("Part") |
| 531 | ball.Shape = Enum.PartType.Ball |
| 532 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 533 | ball.CFrame = CFrame.new(pos) |
| 534 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 535 | ball.Material = Enum.Material.Glacier |
| 536 | ball.MaterialVariant = "2022 Big Stud" |
| 537 | ball.Anchored = true; ball.Parent = workspace |
| 538 | local cuts = {} |
| 539 | do |
| 540 | local h = 0 |
| 541 | local cut = Instance.new("Part") |
| 542 | cut.Size = Vector3.new(4.8, 4.8, 4.8) |
| 543 | cut.CFrame = CFrame.fromMatrix(pos + upV*(-2.4), rightV, upV) |
| 544 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 545 | cut.Material = Enum.Material.Glacier |
| 546 | cut.MaterialVariant = "2022 Big Stud" |
| 547 | cut.Anchored = true; cut.Parent = workspace |
| 548 | table.insert(cuts, cut) |
| 549 | end |
| 550 | if #cuts > 0 then |
| 551 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 552 | for _, c in ipairs(cuts) do c:Destroy() end |
| 553 | if ok and result then |
| 554 | ball:Destroy() |
| 555 | result.Name = "CornerBFL"; result.Anchored = true; result.Parent = model |
| 556 | else |
| 557 | ball.Name = "CornerBFL"; ball.Parent = model |
| 558 | end |
| 559 | else |
| 560 | ball.Name = "CornerBFL"; ball.Parent = model |
| 561 | end |
| 562 | end |
| 563 | do |
| 564 | local upV = Vector3.new(0,1,0).Unit |
| 565 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 566 | local forwardV = rightV:Cross(upV) |
| 567 | local pos = Vector3.new(6, -0.08, -4) |
| 568 | local ball = Instance.new("Part") |
| 569 | ball.Shape = Enum.PartType.Ball |
| 570 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 571 | ball.CFrame = CFrame.new(pos) |
| 572 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 573 | ball.Material = Enum.Material.Glacier |
| 574 | ball.MaterialVariant = "2022 Big Stud" |
| 575 | ball.Anchored = true; ball.Parent = workspace |
| 576 | local cuts = {} |
| 577 | do |
| 578 | local h = 0 |
| 579 | local cut = Instance.new("Part") |
| 580 | cut.Size = Vector3.new(4.8, 4.8, 4.8) |
| 581 | cut.CFrame = CFrame.fromMatrix(pos + upV*(-2.4), rightV, upV) |
| 582 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 583 | cut.Material = Enum.Material.Glacier |
| 584 | cut.MaterialVariant = "2022 Big Stud" |
| 585 | cut.Anchored = true; cut.Parent = workspace |
| 586 | table.insert(cuts, cut) |
| 587 | end |
| 588 | if #cuts > 0 then |
| 589 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 590 | for _, c in ipairs(cuts) do c:Destroy() end |
| 591 | if ok and result then |
| 592 | ball:Destroy() |
| 593 | result.Name = "CornerBFR"; result.Anchored = true; result.Parent = model |
| 594 | else |
| 595 | ball.Name = "CornerBFR"; ball.Parent = model |
| 596 | end |
| 597 | else |
| 598 | ball.Name = "CornerBFR"; ball.Parent = model |
| 599 | end |
| 600 | end |
| 601 | do |
| 602 | local upV = Vector3.new(0,1,0).Unit |
| 603 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 604 | local forwardV = rightV:Cross(upV) |
| 605 | local pos = Vector3.new(-6, -0.08, 4) |
| 606 | local ball = Instance.new("Part") |
| 607 | ball.Shape = Enum.PartType.Ball |
| 608 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 609 | ball.CFrame = CFrame.new(pos) |
| 610 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 611 | ball.Material = Enum.Material.Glacier |
| 612 | ball.MaterialVariant = "2022 Big Stud" |
| 613 | ball.Anchored = true; ball.Parent = workspace |
| 614 | local cuts = {} |
| 615 | do |
| 616 | local h = 0 |
| 617 | local cut = Instance.new("Part") |
| 618 | cut.Size = Vector3.new(4.8, 4.8, 4.8) |
| 619 | cut.CFrame = CFrame.fromMatrix(pos + upV*(-2.4), rightV, upV) |
| 620 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 621 | cut.Material = Enum.Material.Glacier |
| 622 | cut.MaterialVariant = "2022 Big Stud" |
| 623 | cut.Anchored = true; cut.Parent = workspace |
| 624 | table.insert(cuts, cut) |
| 625 | end |
| 626 | if #cuts > 0 then |
| 627 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 628 | for _, c in ipairs(cuts) do c:Destroy() end |
| 629 | if ok and result then |
| 630 | ball:Destroy() |
| 631 | result.Name = "CornerBBL"; result.Anchored = true; result.Parent = model |
| 632 | else |
| 633 | ball.Name = "CornerBBL"; ball.Parent = model |
| 634 | end |
| 635 | else |
| 636 | ball.Name = "CornerBBL"; ball.Parent = model |
| 637 | end |
| 638 | end |
| 639 | do |
| 640 | local upV = Vector3.new(0,1,0).Unit |
| 641 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 642 | local forwardV = rightV:Cross(upV) |
| 643 | local pos = Vector3.new(6, -0.08, 4) |
| 644 | local ball = Instance.new("Part") |
| 645 | ball.Shape = Enum.PartType.Ball |
| 646 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 647 | ball.CFrame = CFrame.new(pos) |
| 648 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 649 | ball.Material = Enum.Material.Glacier |
| 650 | ball.MaterialVariant = "2022 Big Stud" |
| 651 | ball.Anchored = true; ball.Parent = workspace |
| 652 | local cuts = {} |
| 653 | do |
| 654 | local h = 0 |
| 655 | local cut = Instance.new("Part") |
| 656 | cut.Size = Vector3.new(4.8, 4.8, 4.8) |
| 657 | cut.CFrame = CFrame.fromMatrix(pos + upV*(-2.4), rightV, upV) |
| 658 | cut.BrickColor = BrickColor.new("Bright yellow") |
| 659 | cut.Material = Enum.Material.Glacier |
| 660 | cut.MaterialVariant = "2022 Big Stud" |
| 661 | cut.Anchored = true; cut.Parent = workspace |
| 662 | table.insert(cuts, cut) |
| 663 | end |
| 664 | if #cuts > 0 then |
| 665 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 666 | for _, c in ipairs(cuts) do c:Destroy() end |
| 667 | if ok and result then |
| 668 | ball:Destroy() |
| 669 | result.Name = "CornerBBR"; result.Anchored = true; result.Parent = model |
| 670 | else |
| 671 | ball.Name = "CornerBBR"; ball.Parent = model |
| 672 | end |
| 673 | else |
| 674 | ball.Name = "CornerBBR"; ball.Parent = model |
| 675 | end |
| 676 | end |
| 677 | do |
| 678 | local upV = Vector3.new(0,1,0).Unit |
| 679 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 680 | local forwardV = rightV:Cross(upV) |
| 681 | local pos = Vector3.new(-6, 5, -4) |
| 682 | local ball = Instance.new("Part") |
| 683 | ball.Shape = Enum.PartType.Ball |
| 684 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 685 | ball.CFrame = CFrame.new(pos) |
| 686 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 687 | ball.Material = Enum.Material.Glacier |
| 688 | ball.MaterialVariant = "2022 Big Stud" |
| 689 | ball.Anchored = true; ball.Parent = workspace |
| 690 | local cuts = {} |
| 691 | if #cuts > 0 then |
| 692 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 693 | for _, c in ipairs(cuts) do c:Destroy() end |
| 694 | if ok and result then |
| 695 | ball:Destroy() |
| 696 | result.Name = "CornerMFL"; result.Anchored = true; result.Parent = model |
| 697 | else |
| 698 | ball.Name = "CornerMFL"; ball.Parent = model |
| 699 | end |
| 700 | else |
| 701 | ball.Name = "CornerMFL"; ball.Parent = model |
| 702 | end |
| 703 | end |
| 704 | do |
| 705 | local upV = Vector3.new(0,1,0).Unit |
| 706 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 707 | local forwardV = rightV:Cross(upV) |
| 708 | local pos = Vector3.new(6, 5, -4) |
| 709 | local ball = Instance.new("Part") |
| 710 | ball.Shape = Enum.PartType.Ball |
| 711 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 712 | ball.CFrame = CFrame.new(pos) |
| 713 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 714 | ball.Material = Enum.Material.Glacier |
| 715 | ball.MaterialVariant = "2022 Big Stud" |
| 716 | ball.Anchored = true; ball.Parent = workspace |
| 717 | local cuts = {} |
| 718 | if #cuts > 0 then |
| 719 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 720 | for _, c in ipairs(cuts) do c:Destroy() end |
| 721 | if ok and result then |
| 722 | ball:Destroy() |
| 723 | result.Name = "CornerMFR"; result.Anchored = true; result.Parent = model |
| 724 | else |
| 725 | ball.Name = "CornerMFR"; ball.Parent = model |
| 726 | end |
| 727 | else |
| 728 | ball.Name = "CornerMFR"; ball.Parent = model |
| 729 | end |
| 730 | end |
| 731 | do |
| 732 | local upV = Vector3.new(0,1,0).Unit |
| 733 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 734 | local forwardV = rightV:Cross(upV) |
| 735 | local pos = Vector3.new(-6, 5, 4) |
| 736 | local ball = Instance.new("Part") |
| 737 | ball.Shape = Enum.PartType.Ball |
| 738 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 739 | ball.CFrame = CFrame.new(pos) |
| 740 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 741 | ball.Material = Enum.Material.Glacier |
| 742 | ball.MaterialVariant = "2022 Big Stud" |
| 743 | ball.Anchored = true; ball.Parent = workspace |
| 744 | local cuts = {} |
| 745 | if #cuts > 0 then |
| 746 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 747 | for _, c in ipairs(cuts) do c:Destroy() end |
| 748 | if ok and result then |
| 749 | ball:Destroy() |
| 750 | result.Name = "CornerMBL"; result.Anchored = true; result.Parent = model |
| 751 | else |
| 752 | ball.Name = "CornerMBL"; ball.Parent = model |
| 753 | end |
| 754 | else |
| 755 | ball.Name = "CornerMBL"; ball.Parent = model |
| 756 | end |
| 757 | end |
| 758 | do |
| 759 | local upV = Vector3.new(0,1,0).Unit |
| 760 | local rightV = (Vector3.new(1,0,0) - Vector3.new(1,0,0):Dot(upV)*upV).Unit |
| 761 | local forwardV = rightV:Cross(upV) |
| 762 | local pos = Vector3.new(6, 5, 4) |
| 763 | local ball = Instance.new("Part") |
| 764 | ball.Shape = Enum.PartType.Ball |
| 765 | ball.Size = Vector3.new(2.4, 2.4, 2.4) |
| 766 | ball.CFrame = CFrame.new(pos) |
| 767 | ball.BrickColor = BrickColor.new("Bright yellow") |
| 768 | ball.Material = Enum.Material.Glacier |
| 769 | ball.MaterialVariant = "2022 Big Stud" |
| 770 | ball.Anchored = true; ball.Parent = workspace |
| 771 | local cuts = {} |
| 772 | if #cuts > 0 then |
| 773 | local ok, result = pcall(function() return ball:SubtractAsync(cuts) end) |
| 774 | for _, c in ipairs(cuts) do c:Destroy() end |
| 775 | if ok and result then |
| 776 | ball:Destroy() |
| 777 | result.Name = "CornerMBR"; result.Anchored = true; result.Parent = model |
| 778 | else |
| 779 | ball.Name = "CornerMBR"; ball.Parent = model |
| 780 | end |
| 781 | else |
| 782 | ball.Name = "CornerMBR"; ball.Parent = model |
| 783 | end |
| 784 | end |
| 785 | model.PrimaryPart = model:FindFirstChild("BaseWood") |
| 786 | print("TreasureChest built: " .. #model:GetChildren() .. " parts") |
Loading comments...