Loading model...
by <b> · 4/2/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 | ["Gold"] = "2022 Stud", |
| 25 | ["Medium stone grey"] = "2022 Inlet", |
| 26 | ["Pine Cone"] = "2022 Small Stud", |
| 27 | } |
| 28 | do |
| 29 | local p = Instance.new("Part") |
| 30 | p.Name = "BaseFront" |
| 31 | p.Size = Vector3.new(12, 6, 1) |
| 32 | p.CFrame = CFrame.new(0.04, 3.04, -3.54) |
| 33 | p.BrickColor = BrickColor.new("Pine Cone") |
| 34 | p.Material = Enum.Material.Glacier |
| 35 | p.MaterialVariant = "2022 Small Stud" |
| 36 | p.Anchored = true |
| 37 | p.Parent = model |
| 38 | end |
| 39 | do |
| 40 | local p = Instance.new("Part") |
| 41 | p.Name = "BaseBack" |
| 42 | p.Size = Vector3.new(12, 6, 1) |
| 43 | p.CFrame = CFrame.new(0.04, 3.04, 3.54) |
| 44 | p.BrickColor = BrickColor.new("Pine Cone") |
| 45 | p.Material = Enum.Material.Glacier |
| 46 | p.MaterialVariant = "2022 Small Stud" |
| 47 | p.Anchored = true |
| 48 | p.Parent = model |
| 49 | end |
| 50 | do |
| 51 | local p = Instance.new("Part") |
| 52 | p.Name = "BaseLeft" |
| 53 | p.Size = Vector3.new(1, 6, 6) |
| 54 | p.CFrame = CFrame.new(-5.58, 3.08, 0.08) |
| 55 | p.BrickColor = BrickColor.new("Pine Cone") |
| 56 | p.Material = Enum.Material.Glacier |
| 57 | p.MaterialVariant = "2022 Small Stud" |
| 58 | p.Anchored = true |
| 59 | p.Parent = model |
| 60 | end |
| 61 | do |
| 62 | local p = Instance.new("Part") |
| 63 | p.Name = "BaseRight" |
| 64 | p.Size = Vector3.new(1, 6, 6) |
| 65 | p.CFrame = CFrame.new(5.58, 3.08, 0.08) |
| 66 | p.BrickColor = BrickColor.new("Pine Cone") |
| 67 | p.Material = Enum.Material.Glacier |
| 68 | p.MaterialVariant = "2022 Small Stud" |
| 69 | p.Anchored = true |
| 70 | p.Parent = model |
| 71 | end |
| 72 | do |
| 73 | local p = Instance.new("Part") |
| 74 | p.Name = "BaseBottom" |
| 75 | p.Size = Vector3.new(12, 1, 8) |
| 76 | p.CFrame = CFrame.new(0, 0.5, 0) |
| 77 | p.BrickColor = BrickColor.new("Pine Cone") |
| 78 | p.Material = Enum.Material.Glacier |
| 79 | p.MaterialVariant = "2022 Small Stud" |
| 80 | p.Anchored = true |
| 81 | p.Parent = model |
| 82 | end |
| 83 | do |
| 84 | local p = Instance.new("Part") |
| 85 | p.Name = "TrimBaseFront" |
| 86 | p.Size = Vector3.new(12.2, 1, 0.2) |
| 87 | p.CFrame = CFrame.new(0, 1, -4.18) |
| 88 | p.BrickColor = BrickColor.new("Gold") |
| 89 | p.Material = Enum.Material.Glacier |
| 90 | p.MaterialVariant = "2022 Stud" |
| 91 | p.Anchored = true |
| 92 | p.Parent = model |
| 93 | end |
| 94 | do |
| 95 | local p = Instance.new("Part") |
| 96 | p.Name = "TrimBaseBack" |
| 97 | p.Size = Vector3.new(12.2, 1, 0.2) |
| 98 | p.CFrame = CFrame.new(0, 1, 4.18) |
| 99 | p.BrickColor = BrickColor.new("Gold") |
| 100 | p.Material = Enum.Material.Glacier |
| 101 | p.MaterialVariant = "2022 Stud" |
| 102 | p.Anchored = true |
| 103 | p.Parent = model |
| 104 | end |
| 105 | do |
| 106 | local p = Instance.new("Part") |
| 107 | p.Name = "TrimBaseLeft" |
| 108 | p.Size = Vector3.new(0.2, 1, 8.2) |
| 109 | p.CFrame = CFrame.new(-6.26, 1, 0) |
| 110 | p.BrickColor = BrickColor.new("Gold") |
| 111 | p.Material = Enum.Material.Glacier |
| 112 | p.MaterialVariant = "2022 Stud" |
| 113 | p.Anchored = true |
| 114 | p.Parent = model |
| 115 | end |
| 116 | do |
| 117 | local p = Instance.new("Part") |
| 118 | p.Name = "TrimBaseRight" |
| 119 | p.Size = Vector3.new(0.2, 1, 8.2) |
| 120 | p.CFrame = CFrame.new(6.26, 1, 0) |
| 121 | p.BrickColor = BrickColor.new("Gold") |
| 122 | p.Material = Enum.Material.Glacier |
| 123 | p.MaterialVariant = "2022 Stud" |
| 124 | p.Anchored = true |
| 125 | p.Parent = model |
| 126 | end |
| 127 | do |
| 128 | local p = Instance.new("Part") |
| 129 | p.Name = "TrimTopFront" |
| 130 | p.Size = Vector3.new(12.2, 1, 0.2) |
| 131 | p.CFrame = CFrame.new(0, 5.5, -4.18) |
| 132 | p.BrickColor = BrickColor.new("Gold") |
| 133 | p.Material = Enum.Material.Glacier |
| 134 | p.MaterialVariant = "2022 Stud" |
| 135 | p.Anchored = true |
| 136 | p.Parent = model |
| 137 | end |
| 138 | do |
| 139 | local p = Instance.new("Part") |
| 140 | p.Name = "TrimTopBack" |
| 141 | p.Size = Vector3.new(12.2, 1, 0.2) |
| 142 | p.CFrame = CFrame.new(0, 5.5, 4.18) |
| 143 | p.BrickColor = BrickColor.new("Gold") |
| 144 | p.Material = Enum.Material.Glacier |
| 145 | p.MaterialVariant = "2022 Stud" |
| 146 | p.Anchored = true |
| 147 | p.Parent = model |
| 148 | end |
| 149 | do |
| 150 | local p = Instance.new("Part") |
| 151 | p.Name = "TrimTopLeft" |
| 152 | p.Size = Vector3.new(0.2, 1, 8.2) |
| 153 | p.CFrame = CFrame.new(-6.26, 5.5, 0) |
| 154 | p.BrickColor = BrickColor.new("Gold") |
| 155 | p.Material = Enum.Material.Glacier |
| 156 | p.MaterialVariant = "2022 Stud" |
| 157 | p.Anchored = true |
| 158 | p.Parent = model |
| 159 | end |
| 160 | do |
| 161 | local p = Instance.new("Part") |
| 162 | p.Name = "TrimTopRight" |
| 163 | p.Size = Vector3.new(0.2, 1, 8.2) |
| 164 | p.CFrame = CFrame.new(6.26, 5.5, 0) |
| 165 | p.BrickColor = BrickColor.new("Gold") |
| 166 | p.Material = Enum.Material.Glacier |
| 167 | p.MaterialVariant = "2022 Stud" |
| 168 | p.Anchored = true |
| 169 | p.Parent = model |
| 170 | end |
| 171 | do |
| 172 | local p = Instance.new("Part") |
| 173 | p.Name = "LidPlank_0" |
| 174 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 175 | p.CFrame = CFrame.new(-0.04, 6, -4) |
| 176 | p.BrickColor = BrickColor.new("Pine Cone") |
| 177 | p.Material = Enum.Material.Glacier |
| 178 | p.MaterialVariant = "2022 Small Stud" |
| 179 | p.Anchored = true |
| 180 | p.Parent = model |
| 181 | end |
| 182 | do |
| 183 | local p = Instance.new("Part") |
| 184 | p.Name = "LidTrimLeft_0" |
| 185 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 186 | p.CFrame = CFrame.new(-6.18, 6, -4) |
| 187 | p.BrickColor = BrickColor.new("Gold") |
| 188 | p.Material = Enum.Material.Glacier |
| 189 | p.MaterialVariant = "2022 Stud" |
| 190 | p.Anchored = true |
| 191 | p.Parent = model |
| 192 | end |
| 193 | do |
| 194 | local p = Instance.new("Part") |
| 195 | p.Name = "LidTrimRight_0" |
| 196 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 197 | p.CFrame = CFrame.new(6.18, 6, -4) |
| 198 | p.BrickColor = BrickColor.new("Gold") |
| 199 | p.Material = Enum.Material.Glacier |
| 200 | p.MaterialVariant = "2022 Stud" |
| 201 | p.Anchored = true |
| 202 | p.Parent = model |
| 203 | end |
| 204 | do |
| 205 | local p = Instance.new("Part") |
| 206 | p.Name = "LidPlank_1" |
| 207 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 208 | p.CFrame = CFrame.new(-0.04, 7.53073, -3.69552) * CFrame.Angles(math.rad(22.5), math.rad(0), math.rad(0)) |
| 209 | p.BrickColor = BrickColor.new("Pine Cone") |
| 210 | p.Material = Enum.Material.Glacier |
| 211 | p.MaterialVariant = "2022 Small Stud" |
| 212 | p.Anchored = true |
| 213 | p.Parent = model |
| 214 | end |
| 215 | do |
| 216 | local p = Instance.new("Part") |
| 217 | p.Name = "LidTrimLeft_1" |
| 218 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 219 | p.CFrame = CFrame.new(-6.18, 7.53073, -3.69552) * CFrame.Angles(math.rad(22.5), math.rad(0), math.rad(0)) |
| 220 | p.BrickColor = BrickColor.new("Gold") |
| 221 | p.Material = Enum.Material.Glacier |
| 222 | p.MaterialVariant = "2022 Stud" |
| 223 | p.Anchored = true |
| 224 | p.Parent = model |
| 225 | end |
| 226 | do |
| 227 | local p = Instance.new("Part") |
| 228 | p.Name = "LidTrimRight_1" |
| 229 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 230 | p.CFrame = CFrame.new(6.14, 7.53073, -3.69552) * CFrame.Angles(math.rad(22.5), math.rad(0), math.rad(0)) |
| 231 | p.BrickColor = BrickColor.new("Gold") |
| 232 | p.Material = Enum.Material.Glacier |
| 233 | p.MaterialVariant = "2022 Stud" |
| 234 | p.Anchored = true |
| 235 | p.Parent = model |
| 236 | end |
| 237 | do |
| 238 | local p = Instance.new("Part") |
| 239 | p.Name = "LidPlank_2" |
| 240 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 241 | p.CFrame = CFrame.new(-0.04, 8.82843, -2.82843) * CFrame.Angles(math.rad(45), math.rad(0), math.rad(0)) |
| 242 | p.BrickColor = BrickColor.new("Pine Cone") |
| 243 | p.Material = Enum.Material.Glacier |
| 244 | p.MaterialVariant = "2022 Small Stud" |
| 245 | p.Anchored = true |
| 246 | p.Parent = model |
| 247 | end |
| 248 | do |
| 249 | local p = Instance.new("Part") |
| 250 | p.Name = "LidTrimLeft_2" |
| 251 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 252 | p.CFrame = CFrame.new(-6.18, 8.82843, -2.82843) * CFrame.Angles(math.rad(45), math.rad(0), math.rad(0)) |
| 253 | p.BrickColor = BrickColor.new("Gold") |
| 254 | p.Material = Enum.Material.Glacier |
| 255 | p.MaterialVariant = "2022 Stud" |
| 256 | p.Anchored = true |
| 257 | p.Parent = model |
| 258 | end |
| 259 | do |
| 260 | local p = Instance.new("Part") |
| 261 | p.Name = "LidTrimRight_2" |
| 262 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 263 | p.CFrame = CFrame.new(6.14, 8.82843, -2.82843) * CFrame.Angles(math.rad(45), math.rad(0), math.rad(0)) |
| 264 | p.BrickColor = BrickColor.new("Gold") |
| 265 | p.Material = Enum.Material.Glacier |
| 266 | p.MaterialVariant = "2022 Stud" |
| 267 | p.Anchored = true |
| 268 | p.Parent = model |
| 269 | end |
| 270 | do |
| 271 | local p = Instance.new("Part") |
| 272 | p.Name = "LidPlank_3" |
| 273 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 274 | p.CFrame = CFrame.new(-0.04, 9.69552, -1.53073) * CFrame.Angles(math.rad(67.5), math.rad(0), math.rad(0)) |
| 275 | p.BrickColor = BrickColor.new("Pine Cone") |
| 276 | p.Material = Enum.Material.Glacier |
| 277 | p.MaterialVariant = "2022 Small Stud" |
| 278 | p.Anchored = true |
| 279 | p.Parent = model |
| 280 | end |
| 281 | do |
| 282 | local p = Instance.new("Part") |
| 283 | p.Name = "LidTrimLeft_3" |
| 284 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 285 | p.CFrame = CFrame.new(-6.18, 9.69552, -1.53073) * CFrame.Angles(math.rad(67.5), math.rad(0), math.rad(0)) |
| 286 | p.BrickColor = BrickColor.new("Gold") |
| 287 | p.Material = Enum.Material.Glacier |
| 288 | p.MaterialVariant = "2022 Stud" |
| 289 | p.Anchored = true |
| 290 | p.Parent = model |
| 291 | end |
| 292 | do |
| 293 | local p = Instance.new("Part") |
| 294 | p.Name = "LidTrimRight_3" |
| 295 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 296 | p.CFrame = CFrame.new(6.14, 9.69552, -1.53073) * CFrame.Angles(math.rad(67.5), math.rad(0), math.rad(0)) |
| 297 | p.BrickColor = BrickColor.new("Gold") |
| 298 | p.Material = Enum.Material.Glacier |
| 299 | p.MaterialVariant = "2022 Stud" |
| 300 | p.Anchored = true |
| 301 | p.Parent = model |
| 302 | end |
| 303 | do |
| 304 | local p = Instance.new("Part") |
| 305 | p.Name = "LidPlank_4" |
| 306 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 307 | p.CFrame = CFrame.new(-0.04, 10, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) |
| 308 | p.BrickColor = BrickColor.new("Pine Cone") |
| 309 | p.Material = Enum.Material.Glacier |
| 310 | p.MaterialVariant = "2022 Small Stud" |
| 311 | p.Anchored = true |
| 312 | p.Parent = model |
| 313 | end |
| 314 | do |
| 315 | local p = Instance.new("Part") |
| 316 | p.Name = "LidTrimLeft_4" |
| 317 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 318 | p.CFrame = CFrame.new(-6.18, 10, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) |
| 319 | p.BrickColor = BrickColor.new("Gold") |
| 320 | p.Material = Enum.Material.Glacier |
| 321 | p.MaterialVariant = "2022 Stud" |
| 322 | p.Anchored = true |
| 323 | p.Parent = model |
| 324 | end |
| 325 | do |
| 326 | local p = Instance.new("Part") |
| 327 | p.Name = "LidTrimRight_4" |
| 328 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 329 | p.CFrame = CFrame.new(6.14, 10, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) |
| 330 | p.BrickColor = BrickColor.new("Gold") |
| 331 | p.Material = Enum.Material.Glacier |
| 332 | p.MaterialVariant = "2022 Stud" |
| 333 | p.Anchored = true |
| 334 | p.Parent = model |
| 335 | end |
| 336 | do |
| 337 | local p = Instance.new("Part") |
| 338 | p.Name = "LidPlank_5" |
| 339 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 340 | p.CFrame = CFrame.new(-0.04, 9.69552, 1.53073) * CFrame.Angles(math.rad(112.5), math.rad(0), math.rad(0)) |
| 341 | p.BrickColor = BrickColor.new("Pine Cone") |
| 342 | p.Material = Enum.Material.Glacier |
| 343 | p.MaterialVariant = "2022 Small Stud" |
| 344 | p.Anchored = true |
| 345 | p.Parent = model |
| 346 | end |
| 347 | do |
| 348 | local p = Instance.new("Part") |
| 349 | p.Name = "LidTrimLeft_5" |
| 350 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 351 | p.CFrame = CFrame.new(-6.18, 9.69552, 1.53073) * CFrame.Angles(math.rad(112.5), math.rad(0), math.rad(0)) |
| 352 | p.BrickColor = BrickColor.new("Gold") |
| 353 | p.Material = Enum.Material.Glacier |
| 354 | p.MaterialVariant = "2022 Stud" |
| 355 | p.Anchored = true |
| 356 | p.Parent = model |
| 357 | end |
| 358 | do |
| 359 | local p = Instance.new("Part") |
| 360 | p.Name = "LidTrimRight_5" |
| 361 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 362 | p.CFrame = CFrame.new(6.14, 9.69552, 1.53073) * CFrame.Angles(math.rad(112.5), math.rad(0), math.rad(0)) |
| 363 | p.BrickColor = BrickColor.new("Gold") |
| 364 | p.Material = Enum.Material.Glacier |
| 365 | p.MaterialVariant = "2022 Stud" |
| 366 | p.Anchored = true |
| 367 | p.Parent = model |
| 368 | end |
| 369 | do |
| 370 | local p = Instance.new("Part") |
| 371 | p.Name = "LidPlank_6" |
| 372 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 373 | p.CFrame = CFrame.new(-0.04, 8.82843, 2.82843) * CFrame.Angles(math.rad(135), math.rad(0), math.rad(0)) |
| 374 | p.BrickColor = BrickColor.new("Pine Cone") |
| 375 | p.Material = Enum.Material.Glacier |
| 376 | p.MaterialVariant = "2022 Small Stud" |
| 377 | p.Anchored = true |
| 378 | p.Parent = model |
| 379 | end |
| 380 | do |
| 381 | local p = Instance.new("Part") |
| 382 | p.Name = "LidTrimLeft_6" |
| 383 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 384 | p.CFrame = CFrame.new(-6.18, 8.82843, 2.82843) * CFrame.Angles(math.rad(135), math.rad(0), math.rad(0)) |
| 385 | p.BrickColor = BrickColor.new("Gold") |
| 386 | p.Material = Enum.Material.Glacier |
| 387 | p.MaterialVariant = "2022 Stud" |
| 388 | p.Anchored = true |
| 389 | p.Parent = model |
| 390 | end |
| 391 | do |
| 392 | local p = Instance.new("Part") |
| 393 | p.Name = "LidTrimRight_6" |
| 394 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 395 | p.CFrame = CFrame.new(6.14, 8.82843, 2.82843) * CFrame.Angles(math.rad(135), math.rad(0), math.rad(0)) |
| 396 | p.BrickColor = BrickColor.new("Gold") |
| 397 | p.Material = Enum.Material.Glacier |
| 398 | p.MaterialVariant = "2022 Stud" |
| 399 | p.Anchored = true |
| 400 | p.Parent = model |
| 401 | end |
| 402 | do |
| 403 | local p = Instance.new("Part") |
| 404 | p.Name = "LidPlank_7" |
| 405 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 406 | p.CFrame = CFrame.new(-0.04, 7.53073, 3.69552) * CFrame.Angles(math.rad(157.5), math.rad(0), math.rad(0)) |
| 407 | p.BrickColor = BrickColor.new("Pine Cone") |
| 408 | p.Material = Enum.Material.Glacier |
| 409 | p.MaterialVariant = "2022 Small Stud" |
| 410 | p.Anchored = true |
| 411 | p.Parent = model |
| 412 | end |
| 413 | do |
| 414 | local p = Instance.new("Part") |
| 415 | p.Name = "LidTrimLeft_7" |
| 416 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 417 | p.CFrame = CFrame.new(-6.18, 7.53073, 3.69552) * CFrame.Angles(math.rad(157.5), math.rad(0), math.rad(0)) |
| 418 | p.BrickColor = BrickColor.new("Gold") |
| 419 | p.Material = Enum.Material.Glacier |
| 420 | p.MaterialVariant = "2022 Stud" |
| 421 | p.Anchored = true |
| 422 | p.Parent = model |
| 423 | end |
| 424 | do |
| 425 | local p = Instance.new("Part") |
| 426 | p.Name = "LidTrimRight_7" |
| 427 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 428 | p.CFrame = CFrame.new(6.14, 7.53073, 3.69552) * CFrame.Angles(math.rad(157.5), math.rad(0), math.rad(0)) |
| 429 | p.BrickColor = BrickColor.new("Gold") |
| 430 | p.Material = Enum.Material.Glacier |
| 431 | p.MaterialVariant = "2022 Stud" |
| 432 | p.Anchored = true |
| 433 | p.Parent = model |
| 434 | end |
| 435 | do |
| 436 | local p = Instance.new("Part") |
| 437 | p.Name = "LidPlank_8" |
| 438 | p.Size = Vector3.new(12, 0.8, 1.2) |
| 439 | p.CFrame = CFrame.new(-0.04, 6, 4) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(0)) |
| 440 | p.BrickColor = BrickColor.new("Pine Cone") |
| 441 | p.Material = Enum.Material.Glacier |
| 442 | p.MaterialVariant = "2022 Small Stud" |
| 443 | p.Anchored = true |
| 444 | p.Parent = model |
| 445 | end |
| 446 | do |
| 447 | local p = Instance.new("Part") |
| 448 | p.Name = "LidTrimLeft_8" |
| 449 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 450 | p.CFrame = CFrame.new(-6.18, 6, 4) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(0)) |
| 451 | p.BrickColor = BrickColor.new("Gold") |
| 452 | p.Material = Enum.Material.Glacier |
| 453 | p.MaterialVariant = "2022 Stud" |
| 454 | p.Anchored = true |
| 455 | p.Parent = model |
| 456 | end |
| 457 | do |
| 458 | local p = Instance.new("Part") |
| 459 | p.Name = "LidTrimRight_8" |
| 460 | p.Size = Vector3.new(0.2, 0.9, 1.3) |
| 461 | p.CFrame = CFrame.new(6.18, 6, 4) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(0)) |
| 462 | p.BrickColor = BrickColor.new("Gold") |
| 463 | p.Material = Enum.Material.Glacier |
| 464 | p.MaterialVariant = "2022 Stud" |
| 465 | p.Anchored = true |
| 466 | p.Parent = model |
| 467 | end |
| 468 | do |
| 469 | local p = Instance.new("Part") |
| 470 | p.Name = "LatchUpperBase" |
| 471 | p.Size = Vector3.new(2, 1.5, 0.4) |
| 472 | p.CFrame = CFrame.new(0, 7, -4.2) |
| 473 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 474 | p.Material = Enum.Material.Glacier |
| 475 | p.MaterialVariant = "2022 Inlet" |
| 476 | p.Anchored = true |
| 477 | p.Parent = model |
| 478 | end |
| 479 | do |
| 480 | local p = Instance.new("Part") |
| 481 | p.Name = "LatchUpperLoop" |
| 482 | p.Size = Vector3.new(1, 1, 0.6) |
| 483 | p.CFrame = CFrame.new(0, 6.2, -4.4) |
| 484 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 485 | p.Material = Enum.Material.Glacier |
| 486 | p.MaterialVariant = "2022 Inlet" |
| 487 | p.Anchored = true |
| 488 | p.Parent = model |
| 489 | end |
| 490 | do |
| 491 | local p = Instance.new("Part") |
| 492 | p.Name = "LatchLowerBase" |
| 493 | p.Size = Vector3.new(2, 1.5, 0.4) |
| 494 | p.CFrame = CFrame.new(0, 5, -4.32) |
| 495 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 496 | p.Material = Enum.Material.Glacier |
| 497 | p.MaterialVariant = "2022 Inlet" |
| 498 | p.Anchored = true |
| 499 | p.Parent = model |
| 500 | end |
| 501 | do |
| 502 | local p = Instance.new("Part") |
| 503 | p.Name = "LatchLowerHook" |
| 504 | p.Size = Vector3.new(0.6, 1.2, 0.4) |
| 505 | p.CFrame = CFrame.new(0, 5.76, -4.54) |
| 506 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 507 | p.Material = Enum.Material.Glacier |
| 508 | p.MaterialVariant = "2022 Inlet" |
| 509 | p.Anchored = true |
| 510 | p.Parent = model |
| 511 | end |
| 512 | do |
| 513 | local p = Instance.new("Part") |
| 514 | p.Shape = Enum.PartType.Ball |
| 515 | p.Name = "RivetFront_0" |
| 516 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 517 | p.CFrame = CFrame.new(-5, 5.5, -4.2) |
| 518 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 519 | p.Material = Enum.Material.Glacier |
| 520 | p.MaterialVariant = "2022 Inlet" |
| 521 | p.Anchored = true |
| 522 | p.Parent = model |
| 523 | end |
| 524 | do |
| 525 | local p = Instance.new("Part") |
| 526 | p.Shape = Enum.PartType.Ball |
| 527 | p.Name = "RivetFront_1" |
| 528 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 529 | p.CFrame = CFrame.new(0, 5.5, -4.2) |
| 530 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 531 | p.Material = Enum.Material.Glacier |
| 532 | p.MaterialVariant = "2022 Inlet" |
| 533 | p.Anchored = true |
| 534 | p.Parent = model |
| 535 | end |
| 536 | do |
| 537 | local p = Instance.new("Part") |
| 538 | p.Shape = Enum.PartType.Ball |
| 539 | p.Name = "RivetFront_2" |
| 540 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 541 | p.CFrame = CFrame.new(5, 5.5, -4.2) |
| 542 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 543 | p.Material = Enum.Material.Glacier |
| 544 | p.MaterialVariant = "2022 Inlet" |
| 545 | p.Anchored = true |
| 546 | p.Parent = model |
| 547 | end |
| 548 | do |
| 549 | local p = Instance.new("Part") |
| 550 | p.Shape = Enum.PartType.Ball |
| 551 | p.Name = "RivetFront_3" |
| 552 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 553 | p.CFrame = CFrame.new(-5, 1, -4.2) |
| 554 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 555 | p.Material = Enum.Material.Glacier |
| 556 | p.MaterialVariant = "2022 Inlet" |
| 557 | p.Anchored = true |
| 558 | p.Parent = model |
| 559 | end |
| 560 | do |
| 561 | local p = Instance.new("Part") |
| 562 | p.Shape = Enum.PartType.Ball |
| 563 | p.Name = "RivetFront_4" |
| 564 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 565 | p.CFrame = CFrame.new(0, 1, -4.2) |
| 566 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 567 | p.Material = Enum.Material.Glacier |
| 568 | p.MaterialVariant = "2022 Inlet" |
| 569 | p.Anchored = true |
| 570 | p.Parent = model |
| 571 | end |
| 572 | do |
| 573 | local p = Instance.new("Part") |
| 574 | p.Shape = Enum.PartType.Ball |
| 575 | p.Name = "RivetFront_5" |
| 576 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 577 | p.CFrame = CFrame.new(5, 1, -4.2) |
| 578 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 579 | p.Material = Enum.Material.Glacier |
| 580 | p.MaterialVariant = "2022 Inlet" |
| 581 | p.Anchored = true |
| 582 | p.Parent = model |
| 583 | end |
| 584 | do |
| 585 | local p = Instance.new("Part") |
| 586 | p.Shape = Enum.PartType.Ball |
| 587 | p.Name = "RivetLidLeft_0" |
| 588 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 589 | p.CFrame = CFrame.new(-6.2, 6, -4) |
| 590 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 591 | p.Material = Enum.Material.Glacier |
| 592 | p.MaterialVariant = "2022 Inlet" |
| 593 | p.Anchored = true |
| 594 | p.Parent = model |
| 595 | end |
| 596 | do |
| 597 | local p = Instance.new("Part") |
| 598 | p.Shape = Enum.PartType.Ball |
| 599 | p.Name = "RivetLidRight_0" |
| 600 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 601 | p.CFrame = CFrame.new(6.2, 6, -4) |
| 602 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 603 | p.Material = Enum.Material.Glacier |
| 604 | p.MaterialVariant = "2022 Inlet" |
| 605 | p.Anchored = true |
| 606 | p.Parent = model |
| 607 | end |
| 608 | do |
| 609 | local p = Instance.new("Part") |
| 610 | p.Shape = Enum.PartType.Ball |
| 611 | p.Name = "RivetLidLeft_4" |
| 612 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 613 | p.CFrame = CFrame.new(-6.2, 10, 0) |
| 614 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 615 | p.Material = Enum.Material.Glacier |
| 616 | p.MaterialVariant = "2022 Inlet" |
| 617 | p.Anchored = true |
| 618 | p.Parent = model |
| 619 | end |
| 620 | do |
| 621 | local p = Instance.new("Part") |
| 622 | p.Shape = Enum.PartType.Ball |
| 623 | p.Name = "RivetLidRight_4" |
| 624 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 625 | p.CFrame = CFrame.new(6.2, 10, 0) |
| 626 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 627 | p.Material = Enum.Material.Glacier |
| 628 | p.MaterialVariant = "2022 Inlet" |
| 629 | p.Anchored = true |
| 630 | p.Parent = model |
| 631 | end |
| 632 | do |
| 633 | local p = Instance.new("Part") |
| 634 | p.Shape = Enum.PartType.Ball |
| 635 | p.Name = "RivetLidLeft_8" |
| 636 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 637 | p.CFrame = CFrame.new(-6.2, 6, 4) |
| 638 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 639 | p.Material = Enum.Material.Glacier |
| 640 | p.MaterialVariant = "2022 Inlet" |
| 641 | p.Anchored = true |
| 642 | p.Parent = model |
| 643 | end |
| 644 | do |
| 645 | local p = Instance.new("Part") |
| 646 | p.Shape = Enum.PartType.Ball |
| 647 | p.Name = "RivetLidRight_8" |
| 648 | p.Size = Vector3.new(0.4, 0.4, 0.4) |
| 649 | p.CFrame = CFrame.new(6.2, 6, 4) |
| 650 | p.BrickColor = BrickColor.new("Medium stone grey") |
| 651 | p.Material = Enum.Material.Glacier |
| 652 | p.MaterialVariant = "2022 Inlet" |
| 653 | p.Anchored = true |
| 654 | p.Parent = model |
| 655 | end |
| 656 | do |
| 657 | local rightV = Vector3.new(0,0,-1).Unit |
| 658 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 659 | local normalV = upV:Cross(rightV) |
| 660 | local pos = Vector3.new(-5.5, 6.16, 0) |
| 661 | local cyl = Instance.new("Part") |
| 662 | cyl.Shape = Enum.PartType.Cylinder |
| 663 | cyl.Size = Vector3.new(1, 7.6, 7.6) |
| 664 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 665 | cyl.BrickColor = BrickColor.new("Pine Cone") |
| 666 | cyl.Material = Enum.Material.Glacier |
| 667 | cyl.MaterialVariant = "2022 Small Stud" |
| 668 | cyl.Anchored = true; cyl.Parent = workspace |
| 669 | local cuts = {} |
| 670 | local angBoxes = {} |
| 671 | do |
| 672 | local edgeDir = 1*rightV + 0*upV |
| 673 | local edgePerp = 0*rightV + 1*upV |
| 674 | local cut = Instance.new("Part") |
| 675 | cut.Size = Vector3.new(15.2, 1.2, 15.2) |
| 676 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 7.6 * edgePerp, edgeDir, normalV) |
| 677 | cut.BrickColor = BrickColor.new("Pine Cone") |
| 678 | cut.Material = Enum.Material.Glacier |
| 679 | cut.MaterialVariant = "2022 Small Stud" |
| 680 | cut.Anchored = true; cut.Parent = workspace |
| 681 | table.insert(angBoxes, cut) |
| 682 | end |
| 683 | do |
| 684 | local edgeDir = -1*rightV + 0*upV |
| 685 | local edgePerp = 0*rightV + -1*upV |
| 686 | local cut = Instance.new("Part") |
| 687 | cut.Size = Vector3.new(15.2, 1.2, 15.2) |
| 688 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 7.6 * edgePerp, edgeDir, normalV) |
| 689 | cut.BrickColor = BrickColor.new("Pine Cone") |
| 690 | cut.Material = Enum.Material.Glacier |
| 691 | cut.MaterialVariant = "2022 Small Stud" |
| 692 | cut.Anchored = true; cut.Parent = workspace |
| 693 | table.insert(angBoxes, cut) |
| 694 | end |
| 695 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 696 | if #cuts > 0 then |
| 697 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 698 | for _, c in ipairs(cuts) do c:Destroy() end |
| 699 | if ok and result then |
| 700 | cyl:Destroy() |
| 701 | result.Name = "LidSideLeft"; result.Anchored = true; result.Parent = model |
| 702 | else |
| 703 | cyl.Name = "LidSideLeft"; cyl.Parent = model |
| 704 | end |
| 705 | else |
| 706 | cyl.Name = "LidSideLeft"; cyl.Parent = model |
| 707 | end |
| 708 | end |
| 709 | do |
| 710 | local rightV = Vector3.new(0,0,-1).Unit |
| 711 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 712 | local normalV = upV:Cross(rightV) |
| 713 | local pos = Vector3.new(5.5, 6.16, 0) |
| 714 | local cyl = Instance.new("Part") |
| 715 | cyl.Shape = Enum.PartType.Cylinder |
| 716 | cyl.Size = Vector3.new(1, 7.6, 7.6) |
| 717 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 718 | cyl.BrickColor = BrickColor.new("Pine Cone") |
| 719 | cyl.Material = Enum.Material.Glacier |
| 720 | cyl.MaterialVariant = "2022 Small Stud" |
| 721 | cyl.Anchored = true; cyl.Parent = workspace |
| 722 | local cuts = {} |
| 723 | local angBoxes = {} |
| 724 | do |
| 725 | local edgeDir = 1*rightV + 0*upV |
| 726 | local edgePerp = 0*rightV + 1*upV |
| 727 | local cut = Instance.new("Part") |
| 728 | cut.Size = Vector3.new(15.2, 1.2, 15.2) |
| 729 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 7.6 * edgePerp, edgeDir, normalV) |
| 730 | cut.BrickColor = BrickColor.new("Pine Cone") |
| 731 | cut.Material = Enum.Material.Glacier |
| 732 | cut.MaterialVariant = "2022 Small Stud" |
| 733 | cut.Anchored = true; cut.Parent = workspace |
| 734 | table.insert(angBoxes, cut) |
| 735 | end |
| 736 | do |
| 737 | local edgeDir = -1*rightV + 0*upV |
| 738 | local edgePerp = 0*rightV + -1*upV |
| 739 | local cut = Instance.new("Part") |
| 740 | cut.Size = Vector3.new(15.2, 1.2, 15.2) |
| 741 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 7.6 * edgePerp, edgeDir, normalV) |
| 742 | cut.BrickColor = BrickColor.new("Pine Cone") |
| 743 | cut.Material = Enum.Material.Glacier |
| 744 | cut.MaterialVariant = "2022 Small Stud" |
| 745 | cut.Anchored = true; cut.Parent = workspace |
| 746 | table.insert(angBoxes, cut) |
| 747 | end |
| 748 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 749 | if #cuts > 0 then |
| 750 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 751 | for _, c in ipairs(cuts) do c:Destroy() end |
| 752 | if ok and result then |
| 753 | cyl:Destroy() |
| 754 | result.Name = "LidSideRight"; result.Anchored = true; result.Parent = model |
| 755 | else |
| 756 | cyl.Name = "LidSideRight"; cyl.Parent = model |
| 757 | end |
| 758 | else |
| 759 | cyl.Name = "LidSideRight"; cyl.Parent = model |
| 760 | end |
| 761 | end |
| 762 | model.PrimaryPart = model:FindFirstChild("BaseFront") |
| 763 | print("TreasureChest built: " .. #model:GetChildren() .. " parts") |
Loading comments...