Loading model...
by Maxwell Waybrook · 6/11/2026
Lua Script
| 1 | -- Generated with StudForge.org | AI-powered 3D models for Roblox |
| 2 | -- Model: PlantTraderNPC |
| 3 | |
| 4 | -- Generated with StudForge.org | AI-powered 3D models for Roblox |
| 5 | -- Model: PlantTraderNPC |
| 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 = "PlantTraderNPC" |
| 24 | model.Parent = workspace |
| 25 | |
| 26 | local variants = { |
| 27 | ["Bright green"] = "2022 Stud", |
| 28 | ["Bright orange"] = "2022 Stud", |
| 29 | ["Brown"] = "2022 Stud", |
| 30 | ["Dark stone grey"] = "2022 Stud", |
| 31 | ["Earth green"] = "2022 Stud", |
| 32 | ["Gold"] = "2022 Stud", |
| 33 | ["Really black"] = "2022 Universal", |
| 34 | ["Reddish brown"] = "2022 Small Stud", |
| 35 | ["Sand yellow"] = "2022 Small Stud", |
| 36 | ["White"] = "2022 Stud", |
| 37 | } |
| 38 | do |
| 39 | local p = Instance.new("Part") |
| 40 | p.Name = "Body_L1" |
| 41 | p.Size = Vector3.new(2.4, 1, 2.4) |
| 42 | p.CFrame = CFrame.new(0, 0.92, 0) |
| 43 | p.BrickColor = BrickColor.new("Bright orange") |
| 44 | p.Material = Enum.Material.Glacier |
| 45 | p.MaterialVariant = "2022 Stud" |
| 46 | p.Anchored = true |
| 47 | p.Parent = model |
| 48 | end |
| 49 | do |
| 50 | local p = Instance.new("Part") |
| 51 | p.Name = "Body_L2" |
| 52 | p.Size = Vector3.new(3.6, 1, 3.6) |
| 53 | p.CFrame = CFrame.new(0, 1.96, 0) |
| 54 | p.BrickColor = BrickColor.new("Bright orange") |
| 55 | p.Material = Enum.Material.Glacier |
| 56 | p.MaterialVariant = "2022 Stud" |
| 57 | p.Anchored = true |
| 58 | p.Parent = model |
| 59 | end |
| 60 | do |
| 61 | local p = Instance.new("Part") |
| 62 | p.Name = "Body_L3" |
| 63 | p.Size = Vector3.new(4.6, 2, 4.6) |
| 64 | p.CFrame = CFrame.new(0, 3.5, 0) |
| 65 | p.BrickColor = BrickColor.new("Bright orange") |
| 66 | p.Material = Enum.Material.Glacier |
| 67 | p.MaterialVariant = "2022 Stud" |
| 68 | p.Anchored = true |
| 69 | p.Parent = model |
| 70 | end |
| 71 | do |
| 72 | local p = Instance.new("Part") |
| 73 | p.Name = "Body_L4" |
| 74 | p.Size = Vector3.new(4.2, 1, 4.2) |
| 75 | p.CFrame = CFrame.new(0, 5.04, 0.04) |
| 76 | p.BrickColor = BrickColor.new("Bright orange") |
| 77 | p.Material = Enum.Material.Glacier |
| 78 | p.MaterialVariant = "2022 Stud" |
| 79 | p.Anchored = true |
| 80 | p.Parent = model |
| 81 | end |
| 82 | do |
| 83 | local p = Instance.new("Part") |
| 84 | p.Name = "Body_L5" |
| 85 | p.Size = Vector3.new(3.2, 1, 3.2) |
| 86 | p.CFrame = CFrame.new(0, 6.08, -0.04) |
| 87 | p.BrickColor = BrickColor.new("Bright orange") |
| 88 | p.Material = Enum.Material.Glacier |
| 89 | p.MaterialVariant = "2022 Stud" |
| 90 | p.Anchored = true |
| 91 | p.Parent = model |
| 92 | end |
| 93 | do |
| 94 | local p = Instance.new("Part") |
| 95 | p.Name = "Body_L6" |
| 96 | p.Size = Vector3.new(2, 0.6, 2) |
| 97 | p.CFrame = CFrame.new(0, 6.92, 0) |
| 98 | p.BrickColor = BrickColor.new("Bright orange") |
| 99 | p.Material = Enum.Material.Glacier |
| 100 | p.MaterialVariant = "2022 Stud" |
| 101 | p.Anchored = true |
| 102 | p.Parent = model |
| 103 | end |
| 104 | do |
| 105 | local p = Instance.new("Part") |
| 106 | p.Name = "RootTip" |
| 107 | p.Size = Vector3.new(0.8, 0.5, 0.8) |
| 108 | p.CFrame = CFrame.new(0, 0.13, 0) |
| 109 | p.BrickColor = BrickColor.new("Bright orange") |
| 110 | p.Material = Enum.Material.Glacier |
| 111 | p.MaterialVariant = "2022 Stud" |
| 112 | p.Anchored = true |
| 113 | p.Parent = model |
| 114 | end |
| 115 | do |
| 116 | local p = Instance.new("Part") |
| 117 | p.Name = "Cloak_Back" |
| 118 | p.Size = Vector3.new(4.8, 5, 1.2) |
| 119 | p.CFrame = CFrame.new(0, 3.5, 2) |
| 120 | p.BrickColor = BrickColor.new("Earth green") |
| 121 | p.Material = Enum.Material.Glacier |
| 122 | p.MaterialVariant = "2022 Stud" |
| 123 | p.Anchored = true |
| 124 | p.Parent = model |
| 125 | end |
| 126 | do |
| 127 | local p = Instance.new("Part") |
| 128 | p.Name = "Cloak_SideL" |
| 129 | p.Size = Vector3.new(1.2, 5, 4.2) |
| 130 | p.CFrame = CFrame.new(-2, 3.58, 0.42) |
| 131 | p.BrickColor = BrickColor.new("Earth green") |
| 132 | p.Material = Enum.Material.Glacier |
| 133 | p.MaterialVariant = "2022 Stud" |
| 134 | p.Anchored = true |
| 135 | p.Parent = model |
| 136 | end |
| 137 | do |
| 138 | local p = Instance.new("Part") |
| 139 | p.Name = "Cloak_SideR" |
| 140 | p.Size = Vector3.new(1.2, 5, 4.2) |
| 141 | p.CFrame = CFrame.new(2, 3.58, 0.42) |
| 142 | p.BrickColor = BrickColor.new("Earth green") |
| 143 | p.Material = Enum.Material.Glacier |
| 144 | p.MaterialVariant = "2022 Stud" |
| 145 | p.Anchored = true |
| 146 | p.Parent = model |
| 147 | end |
| 148 | do |
| 149 | local p = Instance.new("Part") |
| 150 | p.Name = "Cloak_TopBack" |
| 151 | p.Size = Vector3.new(4.4, 1.5, 2.2) |
| 152 | p.CFrame = CFrame.new(0, 5.5, 1.46) |
| 153 | p.BrickColor = BrickColor.new("Earth green") |
| 154 | p.Material = Enum.Material.Glacier |
| 155 | p.MaterialVariant = "2022 Stud" |
| 156 | p.Anchored = true |
| 157 | p.Parent = model |
| 158 | end |
| 159 | do |
| 160 | local p = Instance.new("Part") |
| 161 | p.Name = "Cloak_Hood" |
| 162 | p.Size = Vector3.new(3.6, 1, 3.6) |
| 163 | p.CFrame = CFrame.new(0, 6.54, 0.5) |
| 164 | p.BrickColor = BrickColor.new("Earth green") |
| 165 | p.Material = Enum.Material.Glacier |
| 166 | p.MaterialVariant = "2022 Stud" |
| 167 | p.Anchored = true |
| 168 | p.Parent = model |
| 169 | end |
| 170 | do |
| 171 | local p = Instance.new("Part") |
| 172 | p.Shape = Enum.PartType.Cylinder |
| 173 | p.Name = "Cloak_Clasp" |
| 174 | p.Size = Vector3.new(0.4, 0.8, 0.8) |
| 175 | p.CFrame = CFrame.new(0, 4.5, -2.3) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 176 | p.BrickColor = BrickColor.new("Gold") |
| 177 | p.Material = Enum.Material.Glacier |
| 178 | p.MaterialVariant = "2022 Stud" |
| 179 | p.Anchored = true |
| 180 | p.Parent = model |
| 181 | end |
| 182 | do |
| 183 | local p = Instance.new("Part") |
| 184 | p.Shape = Enum.PartType.Cylinder |
| 185 | p.Name = "Eye_L" |
| 186 | p.Size = Vector3.new(0.2, 1.4, 1.4) |
| 187 | p.CFrame = CFrame.new(-1, 4.2, -2.35) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 188 | p.BrickColor = BrickColor.new("Really black") |
| 189 | p.Material = Enum.Material.Glacier |
| 190 | p.MaterialVariant = "2022 Universal" |
| 191 | p.Anchored = true |
| 192 | p.Parent = model |
| 193 | end |
| 194 | do |
| 195 | local p = Instance.new("Part") |
| 196 | p.Shape = Enum.PartType.Cylinder |
| 197 | p.Name = "Eye_R" |
| 198 | p.Size = Vector3.new(0.2, 1.4, 1.4) |
| 199 | p.CFrame = CFrame.new(1, 4.2, -2.35) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 200 | p.BrickColor = BrickColor.new("Really black") |
| 201 | p.Material = Enum.Material.Glacier |
| 202 | p.MaterialVariant = "2022 Universal" |
| 203 | p.Anchored = true |
| 204 | p.Parent = model |
| 205 | end |
| 206 | do |
| 207 | local p = Instance.new("Part") |
| 208 | p.Shape = Enum.PartType.Cylinder |
| 209 | p.Name = "Pupil_L" |
| 210 | p.Size = Vector3.new(0.2, 0.5, 0.5) |
| 211 | p.CFrame = CFrame.new(-0.8, 4.4, -2.41) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 212 | p.BrickColor = BrickColor.new("White") |
| 213 | p.Material = Enum.Material.Glacier |
| 214 | p.MaterialVariant = "2022 Stud" |
| 215 | p.Anchored = true |
| 216 | p.Parent = model |
| 217 | end |
| 218 | do |
| 219 | local p = Instance.new("Part") |
| 220 | p.Shape = Enum.PartType.Cylinder |
| 221 | p.Name = "Pupil_R" |
| 222 | p.Size = Vector3.new(0.2, 0.5, 0.5) |
| 223 | p.CFrame = CFrame.new(0.8, 4.4, -2.41) * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) |
| 224 | p.BrickColor = BrickColor.new("White") |
| 225 | p.Material = Enum.Material.Glacier |
| 226 | p.MaterialVariant = "2022 Stud" |
| 227 | p.Anchored = true |
| 228 | p.Parent = model |
| 229 | end |
| 230 | do |
| 231 | local p = Instance.new("Part") |
| 232 | p.Name = "Brow_L" |
| 233 | p.Size = Vector3.new(1.6, 0.3, 0.3) |
| 234 | p.CFrame = CFrame.new(-1.2, 5.1, -2.48) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(25)) |
| 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 = "Brow_R" |
| 244 | p.Size = Vector3.new(1.6, 0.3, 0.3) |
| 245 | p.CFrame = CFrame.new(1.2, 5.1, -2.48) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-25)) |
| 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 = "Stem" |
| 255 | p.Size = Vector3.new(0.8, 1.5, 0.8) |
| 256 | p.CFrame = CFrame.new(0, 7.5, 0) |
| 257 | p.BrickColor = BrickColor.new("Bright green") |
| 258 | p.Material = Enum.Material.Glacier |
| 259 | p.MaterialVariant = "2022 Stud" |
| 260 | p.Anchored = true |
| 261 | p.Parent = model |
| 262 | end |
| 263 | do |
| 264 | local p = Instance.new("Part") |
| 265 | p.Name = "Leaf_1" |
| 266 | p.Size = Vector3.new(2.5, 0.6, 0.2) |
| 267 | p.CFrame = CFrame.new(0.75, 9, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(53.1301)) |
| 268 | p.BrickColor = BrickColor.new("Bright green") |
| 269 | p.Material = Enum.Material.Glacier |
| 270 | p.MaterialVariant = "2022 Stud" |
| 271 | p.Anchored = true |
| 272 | p.Parent = model |
| 273 | end |
| 274 | do |
| 275 | local p = Instance.new("Part") |
| 276 | p.Name = "Leaf_2" |
| 277 | p.Size = Vector3.new(2.5, 0.6, 0.2) |
| 278 | p.CFrame = CFrame.new(-0.75, 9, 0) * CFrame.Angles(math.rad(-180), math.rad(0), math.rad(-126.87)) |
| 279 | p.BrickColor = BrickColor.new("Bright green") |
| 280 | p.Material = Enum.Material.Glacier |
| 281 | p.MaterialVariant = "2022 Stud" |
| 282 | p.Anchored = true |
| 283 | p.Parent = model |
| 284 | end |
| 285 | do |
| 286 | local p = Instance.new("Part") |
| 287 | p.Name = "Leaf_3" |
| 288 | p.Size = Vector3.new(2.12132, 0.6, 0.2) |
| 289 | p.CFrame = CFrame.new(0, 8.75, -0.75) * CFrame.Angles(math.rad(45), math.rad(90), math.rad(0)) |
| 290 | p.BrickColor = BrickColor.new("Bright green") |
| 291 | p.Material = Enum.Material.Glacier |
| 292 | p.MaterialVariant = "2022 Stud" |
| 293 | p.Anchored = true |
| 294 | p.Parent = model |
| 295 | end |
| 296 | do |
| 297 | local p = Instance.new("Part") |
| 298 | p.Name = "Leaf_4" |
| 299 | p.Size = Vector3.new(2.12132, 0.6, 0.2) |
| 300 | p.CFrame = CFrame.new(0, 8.75, 0.75) * CFrame.Angles(math.rad(-45), math.rad(-90), math.rad(0)) |
| 301 | p.BrickColor = BrickColor.new("Bright green") |
| 302 | p.Material = Enum.Material.Glacier |
| 303 | p.MaterialVariant = "2022 Stud" |
| 304 | p.Anchored = true |
| 305 | p.Parent = model |
| 306 | end |
| 307 | do |
| 308 | local p = Instance.new("Part") |
| 309 | p.Name = "Arm_L" |
| 310 | p.Size = Vector3.new(2.34521, 0.8, 0.8) |
| 311 | p.CFrame = CFrame.new(-3.25, 2.75, -0.5) * CFrame.Angles(math.rad(-180), math.rad(33.6901), math.rad(140.238)) |
| 312 | p.BrickColor = BrickColor.new("Bright orange") |
| 313 | p.Material = Enum.Material.Glacier |
| 314 | p.MaterialVariant = "2022 Stud" |
| 315 | p.Anchored = true |
| 316 | p.Parent = model |
| 317 | end |
| 318 | do |
| 319 | local p = Instance.new("Part") |
| 320 | p.Name = "Arm_R" |
| 321 | p.Size = Vector3.new(2.17945, 0.8, 0.8) |
| 322 | p.CFrame = CFrame.new(3.25, 3.25, -0.75) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(-13.2627)) |
| 323 | p.BrickColor = BrickColor.new("Bright orange") |
| 324 | p.Material = Enum.Material.Glacier |
| 325 | p.MaterialVariant = "2022 Stud" |
| 326 | p.Anchored = true |
| 327 | p.Parent = model |
| 328 | end |
| 329 | do |
| 330 | local p = Instance.new("Part") |
| 331 | p.Name = "Backpack_Main" |
| 332 | p.Size = Vector3.new(3.6, 4, 1.6) |
| 333 | p.CFrame = CFrame.new(0, 3.5, 3.2) |
| 334 | p.BrickColor = BrickColor.new("Brown") |
| 335 | p.Material = Enum.Material.Glacier |
| 336 | p.MaterialVariant = "2022 Stud" |
| 337 | p.Anchored = true |
| 338 | p.Parent = model |
| 339 | end |
| 340 | do |
| 341 | local p = Instance.new("Part") |
| 342 | p.Name = "Backpack_Flap" |
| 343 | p.Size = Vector3.new(3.8, 0.4, 1.8) |
| 344 | p.CFrame = CFrame.new(0, 5.6, 3.3) * CFrame.Angles(math.rad(-10), math.rad(0), math.rad(0)) |
| 345 | p.BrickColor = BrickColor.new("Brown") |
| 346 | p.Material = Enum.Material.Glacier |
| 347 | p.MaterialVariant = "2022 Stud" |
| 348 | p.Anchored = true |
| 349 | p.Parent = model |
| 350 | end |
| 351 | do |
| 352 | local p = Instance.new("Part") |
| 353 | p.Shape = Enum.PartType.Cylinder |
| 354 | p.Name = "Backpack_Roll" |
| 355 | p.Size = Vector3.new(3.4, 1.2, 1.2) |
| 356 | p.CFrame = CFrame.new(0, 6.2, 3) |
| 357 | p.BrickColor = BrickColor.new("Sand yellow") |
| 358 | p.Material = Enum.Material.Glacier |
| 359 | p.MaterialVariant = "2022 Small Stud" |
| 360 | p.Anchored = true |
| 361 | p.Parent = model |
| 362 | end |
| 363 | do |
| 364 | local p = Instance.new("Part") |
| 365 | p.Name = "Pouch" |
| 366 | p.Size = Vector3.new(1.2, 1.6, 1.2) |
| 367 | p.CFrame = CFrame.new(-2.8, 2.5, 0) |
| 368 | p.BrickColor = BrickColor.new("Brown") |
| 369 | p.Material = Enum.Material.Glacier |
| 370 | p.MaterialVariant = "2022 Stud" |
| 371 | p.Anchored = true |
| 372 | p.Parent = model |
| 373 | end |
| 374 | do |
| 375 | local p = Instance.new("Part") |
| 376 | p.Name = "Pouch_Flap" |
| 377 | p.Size = Vector3.new(1.4, 0.2, 1.4) |
| 378 | p.CFrame = CFrame.new(-2.9, 3.4, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(10)) |
| 379 | p.BrickColor = BrickColor.new("Brown") |
| 380 | p.Material = Enum.Material.Glacier |
| 381 | p.MaterialVariant = "2022 Stud" |
| 382 | p.Anchored = true |
| 383 | p.Parent = model |
| 384 | end |
| 385 | do |
| 386 | local p = Instance.new("Part") |
| 387 | p.Shape = Enum.PartType.Cylinder |
| 388 | p.Name = "Staff" |
| 389 | p.Size = Vector3.new(8.26136, 0.5, 0.5) |
| 390 | p.CFrame = CFrame.new(4.25, 4, -1.5) * CFrame.Angles(math.rad(-180), math.rad(75.9638), math.rad(-104.45)) |
| 391 | p.BrickColor = BrickColor.new("Reddish brown") |
| 392 | p.Material = Enum.Material.Glacier |
| 393 | p.MaterialVariant = "2022 Small Stud" |
| 394 | p.Anchored = true |
| 395 | p.Parent = model |
| 396 | end |
| 397 | do |
| 398 | local p = Instance.new("Part") |
| 399 | p.Name = "Lantern_Chain" |
| 400 | p.Size = Vector3.new(1.5, 0.1, 0.1) |
| 401 | p.CFrame = CFrame.new(4.1, 6.25, -2.1) * CFrame.Angles(math.rad(180), math.rad(0), math.rad(90)) |
| 402 | p.BrickColor = BrickColor.new("Dark stone grey") |
| 403 | p.Material = Enum.Material.Glacier |
| 404 | p.MaterialVariant = "2022 Stud" |
| 405 | p.Anchored = true |
| 406 | p.Parent = model |
| 407 | end |
| 408 | do |
| 409 | local p = Instance.new("Part") |
| 410 | p.Name = "Lantern_Top" |
| 411 | p.Size = Vector3.new(1.2, 0.3, 1.2) |
| 412 | p.CFrame = CFrame.new(4.1, 6.2, -2.1) |
| 413 | p.BrickColor = BrickColor.new("Dark stone grey") |
| 414 | p.Material = Enum.Material.Glacier |
| 415 | p.MaterialVariant = "2022 Stud" |
| 416 | p.Anchored = true |
| 417 | p.Parent = model |
| 418 | end |
| 419 | do |
| 420 | local p = Instance.new("Part") |
| 421 | p.Name = "Lantern_Base" |
| 422 | p.Size = Vector3.new(1.2, 0.3, 1.2) |
| 423 | p.CFrame = CFrame.new(4.1, 4.8, -2.1) |
| 424 | p.BrickColor = BrickColor.new("Dark stone grey") |
| 425 | p.Material = Enum.Material.Glacier |
| 426 | p.MaterialVariant = "2022 Stud" |
| 427 | p.Anchored = true |
| 428 | p.Parent = model |
| 429 | end |
| 430 | do |
| 431 | local p = Instance.new("Part") |
| 432 | p.Name = "Lantern_Glow" |
| 433 | p.Size = Vector3.new(0.8, 1.2, 0.8) |
| 434 | p.CFrame = CFrame.new(4.1, 5.5, -2.1) |
| 435 | p.BrickColor = BrickColor.new("New Yeller") |
| 436 | p.Material = Enum.Material.Neon |
| 437 | p.Anchored = true |
| 438 | p.Parent = model |
| 439 | end |
| 440 | do |
| 441 | local rightV = Vector3.new(1,0,0).Unit |
| 442 | local upV = (Vector3.new(0,1,0) - Vector3.new(0,1,0):Dot(rightV)*rightV).Unit |
| 443 | local normalV = upV:Cross(rightV) |
| 444 | local pos = Vector3.new(0, 3.2, -2.44) |
| 445 | local cyl = Instance.new("Part") |
| 446 | cyl.Shape = Enum.PartType.Cylinder |
| 447 | cyl.Size = Vector3.new(0.2, 1.8, 1.8) |
| 448 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 449 | cyl.BrickColor = BrickColor.new("Really black") |
| 450 | cyl.Material = Enum.Material.Glacier |
| 451 | cyl.MaterialVariant = "2022 Universal" |
| 452 | cyl.Anchored = true; cyl.Parent = workspace |
| 453 | local cuts = {} |
| 454 | local hole = Instance.new("Part") |
| 455 | hole.Shape = Enum.PartType.Cylinder |
| 456 | hole.Size = Vector3.new(0.4, 1.2, 1.2) |
| 457 | hole.CFrame = cyl.CFrame |
| 458 | hole.BrickColor = BrickColor.new("Really black") |
| 459 | hole.Material = Enum.Material.Glacier |
| 460 | hole.MaterialVariant = "2022 Universal" |
| 461 | hole.Anchored = true; hole.Parent = workspace |
| 462 | table.insert(cuts, hole) |
| 463 | local angBoxes = {} |
| 464 | do |
| 465 | local edgeDir = -1*rightV + 0*upV |
| 466 | local edgePerp = 0*rightV + -1*upV |
| 467 | local cut = Instance.new("Part") |
| 468 | cut.Size = Vector3.new(3.6, 0.4, 3.6) |
| 469 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 1.8 * edgePerp, edgeDir, normalV) |
| 470 | cut.BrickColor = BrickColor.new("Really black") |
| 471 | cut.Material = Enum.Material.Glacier |
| 472 | cut.MaterialVariant = "2022 Universal" |
| 473 | cut.Anchored = true; cut.Parent = workspace |
| 474 | table.insert(angBoxes, cut) |
| 475 | end |
| 476 | do |
| 477 | local edgeDir = 1*rightV + 0*upV |
| 478 | local edgePerp = 0*rightV + 1*upV |
| 479 | local cut = Instance.new("Part") |
| 480 | cut.Size = Vector3.new(3.6, 0.4, 3.6) |
| 481 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 1.8 * edgePerp, edgeDir, normalV) |
| 482 | cut.BrickColor = BrickColor.new("Really black") |
| 483 | cut.Material = Enum.Material.Glacier |
| 484 | cut.MaterialVariant = "2022 Universal" |
| 485 | cut.Anchored = true; cut.Parent = workspace |
| 486 | table.insert(angBoxes, cut) |
| 487 | end |
| 488 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 489 | if #cuts > 0 then |
| 490 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 491 | for _, c in ipairs(cuts) do c:Destroy() end |
| 492 | if ok and result then |
| 493 | cyl:Destroy() |
| 494 | result.Name = "Smile"; result.Anchored = true; result.Parent = model |
| 495 | else |
| 496 | cyl.Name = "Smile"; cyl.Parent = model |
| 497 | end |
| 498 | else |
| 499 | cyl.Name = "Smile"; cyl.Parent = model |
| 500 | end |
| 501 | end |
| 502 | model.PrimaryPart = model:FindFirstChild("Body_L3") |
| 503 | print("PlantTraderNPC built: " .. #model:GetChildren() .. " parts") |
Loading comments...