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