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