Loading model...
by Privd123 Chicken · 10/7/2026
Lua Script
| 1 | -- Generated with StudForge.org | AI-powered 3D models for Roblox |
| 2 | -- Model: HalloweenLollipop |
| 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 = "HalloweenLollipop" |
| 21 | model.Parent = workspace |
| 22 | |
| 23 | local variants = { |
| 24 | ["Bright violet"] = "2022 Stud", |
| 25 | ["Light stone grey"] = "2022 Glue", |
| 26 | ["Magenta"] = "2022 Stud", |
| 27 | } |
| 28 | do |
| 29 | local p = Instance.new("Part") |
| 30 | p.Shape = Enum.PartType.Cylinder |
| 31 | p.Name = "Stick" |
| 32 | p.Size = Vector3.new(5.65685, 0.4, 0.4) |
| 33 | p.CFrame = CFrame.new(-2, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(45)) |
| 34 | p.BrickColor = BrickColor.new("Light stone grey") |
| 35 | p.Material = Enum.Material.Glacier |
| 36 | p.MaterialVariant = "2022 Glue" |
| 37 | p.Anchored = true |
| 38 | p.Parent = model |
| 39 | end |
| 40 | do |
| 41 | local p = Instance.new("Part") |
| 42 | p.Name = "Ridge_0" |
| 43 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 44 | p.CFrame = CFrame.new(0.353553, 4.35355, 0) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(0)) |
| 45 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_1" |
| 54 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 55 | p.CFrame = CFrame.new(0.406962, 4.40696, 0.154213) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(15)) |
| 56 | p.BrickColor = BrickColor.new("Magenta") |
| 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 = "Ridge_2" |
| 65 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 66 | p.CFrame = CFrame.new(0.423558, 4.42356, 0.345833) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(30)) |
| 67 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_3" |
| 76 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 77 | p.CFrame = CFrame.new(0.39375, 4.39375, 0.556847) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(45)) |
| 78 | p.BrickColor = BrickColor.new("Magenta") |
| 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 = "Ridge_4" |
| 87 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 88 | p.CFrame = CFrame.new(0.312305, 4.31231, 0.764989) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(60)) |
| 89 | p.BrickColor = BrickColor.new("Bright violet") |
| 90 | p.Material = Enum.Material.Glacier |
| 91 | p.MaterialVariant = "2022 Stud" |
| 92 | p.Anchored = true |
| 93 | p.Parent = model |
| 94 | end |
| 95 | do |
| 96 | local p = Instance.new("Part") |
| 97 | p.Name = "Ridge_5" |
| 98 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 99 | p.CFrame = CFrame.new(0.1792, 4.1792, 0.945802) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(75)) |
| 100 | p.BrickColor = BrickColor.new("Magenta") |
| 101 | p.Material = Enum.Material.Glacier |
| 102 | p.MaterialVariant = "2022 Stud" |
| 103 | p.Anchored = true |
| 104 | p.Parent = model |
| 105 | end |
| 106 | do |
| 107 | local p = Instance.new("Part") |
| 108 | p.Name = "Ridge_6" |
| 109 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 110 | p.CFrame = CFrame.new(0, 4, 1.075) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(90)) |
| 111 | p.BrickColor = BrickColor.new("Bright violet") |
| 112 | p.Material = Enum.Material.Glacier |
| 113 | p.MaterialVariant = "2022 Stud" |
| 114 | p.Anchored = true |
| 115 | p.Parent = model |
| 116 | end |
| 117 | do |
| 118 | local p = Instance.new("Part") |
| 119 | p.Name = "Ridge_7" |
| 120 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 121 | p.CFrame = CFrame.new(-0.214277, 3.78572, 1.13094) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(105)) |
| 122 | p.BrickColor = BrickColor.new("Magenta") |
| 123 | p.Material = Enum.Material.Glacier |
| 124 | p.MaterialVariant = "2022 Stud" |
| 125 | p.Anchored = true |
| 126 | p.Parent = model |
| 127 | end |
| 128 | do |
| 129 | local p = Instance.new("Part") |
| 130 | p.Name = "Ridge_8" |
| 131 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 132 | p.CFrame = CFrame.new(-0.447834, 3.55217, 1.09697) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(120)) |
| 133 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_9" |
| 142 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 143 | p.CFrame = CFrame.new(-0.68125, 3.31875, 0.963433) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(135)) |
| 144 | p.BrickColor = BrickColor.new("Magenta") |
| 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 = "Ridge_10" |
| 153 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 154 | p.CFrame = CFrame.new(-0.893043, 3.10696, 0.729167) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(150)) |
| 155 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_11" |
| 164 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 165 | p.CFrame = CFrame.new(-1.06152, 2.93848, 0.402248) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(165)) |
| 166 | p.BrickColor = BrickColor.new("Magenta") |
| 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 = "Ridge_12" |
| 175 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 176 | p.CFrame = CFrame.new(-1.16673, 2.83327, 0) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(180)) |
| 177 | p.BrickColor = BrickColor.new("Bright violet") |
| 178 | p.Material = Enum.Material.Glacier |
| 179 | p.MaterialVariant = "2022 Stud" |
| 180 | p.Anchored = true |
| 181 | p.Parent = model |
| 182 | end |
| 183 | do |
| 184 | local p = Instance.new("Part") |
| 185 | p.Name = "Ridge_13" |
| 186 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 187 | p.CFrame = CFrame.new(-1.19243, 2.80757, -0.451855) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(195)) |
| 188 | p.BrickColor = BrickColor.new("Magenta") |
| 189 | p.Material = Enum.Material.Glacier |
| 190 | p.MaterialVariant = "2022 Stud" |
| 191 | p.Anchored = true |
| 192 | p.Parent = model |
| 193 | end |
| 194 | do |
| 195 | local p = Instance.new("Part") |
| 196 | p.Name = "Ridge_14" |
| 197 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 198 | p.CFrame = CFrame.new(-1.12779, 2.87221, -0.920833) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(210)) |
| 199 | p.BrickColor = BrickColor.new("Bright violet") |
| 200 | p.Material = Enum.Material.Glacier |
| 201 | p.MaterialVariant = "2022 Stud" |
| 202 | p.Anchored = true |
| 203 | p.Parent = model |
| 204 | end |
| 205 | do |
| 206 | local p = Instance.new("Part") |
| 207 | p.Name = "Ridge_15" |
| 208 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 209 | p.CFrame = CFrame.new(-0.96875, 3.03125, -1.37002) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(225)) |
| 210 | p.BrickColor = BrickColor.new("Magenta") |
| 211 | p.Material = Enum.Material.Glacier |
| 212 | p.MaterialVariant = "2022 Stud" |
| 213 | p.Anchored = true |
| 214 | p.Parent = model |
| 215 | end |
| 216 | do |
| 217 | local p = Instance.new("Part") |
| 218 | p.Name = "Ridge_16" |
| 219 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 220 | p.CFrame = CFrame.new(-0.718892, 3.28111, -1.76092) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(240)) |
| 221 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_17" |
| 230 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 231 | p.CFrame = CFrame.new(-0.389665, 3.61034, -2.05662) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(255)) |
| 232 | p.BrickColor = BrickColor.new("Magenta") |
| 233 | p.Material = Enum.Material.Glacier |
| 234 | p.MaterialVariant = "2022 Stud" |
| 235 | p.Anchored = true |
| 236 | p.Parent = model |
| 237 | end |
| 238 | do |
| 239 | local p = Instance.new("Part") |
| 240 | p.Name = "Ridge_18" |
| 241 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 242 | p.CFrame = CFrame.new(0, 4, -2.225) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(270)) |
| 243 | p.BrickColor = BrickColor.new("Bright violet") |
| 244 | p.Material = Enum.Material.Glacier |
| 245 | p.MaterialVariant = "2022 Stud" |
| 246 | p.Anchored = true |
| 247 | p.Parent = model |
| 248 | end |
| 249 | do |
| 250 | local p = Instance.new("Part") |
| 251 | p.Name = "Ridge_19" |
| 252 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 253 | p.CFrame = CFrame.new(0.424742, 4.42474, -2.24175) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(285)) |
| 254 | p.BrickColor = BrickColor.new("Magenta") |
| 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 = "Ridge_20" |
| 263 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 264 | p.CFrame = CFrame.new(0.854421, 4.85442, -2.09289) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(300)) |
| 265 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_21" |
| 274 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 275 | p.CFrame = CFrame.new(1.25625, 5.25625, -1.77661) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(315)) |
| 276 | p.BrickColor = BrickColor.new("Magenta") |
| 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 = "Ridge_22" |
| 285 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 286 | p.CFrame = CFrame.new(1.56899, 5.59727, -1.33245) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(330)) |
| 287 | p.BrickColor = BrickColor.new("Bright violet") |
| 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 = "Ridge_23" |
| 296 | p.Size = Vector3.new(0.6, 0.6, 0.6) |
| 297 | p.CFrame = CFrame.new(1.84698, 5.84698, -0.69989) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(345)) |
| 298 | p.BrickColor = BrickColor.new("Magenta") |
| 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.Shape = Enum.PartType.Ball |
| 307 | p.Name = "CenterCap" |
| 308 | p.Size = Vector3.new(0.9, 0.9, 0.9) |
| 309 | p.CFrame = CFrame.new(0, 4, 0) |
| 310 | p.BrickColor = BrickColor.new("Magenta") |
| 311 | p.Material = Enum.Material.Glacier |
| 312 | p.MaterialVariant = "2022 Stud" |
| 313 | p.Anchored = true |
| 314 | p.Parent = model |
| 315 | end |
| 316 | do |
| 317 | local rightV = Vector3.new(0.707107,0.707107,0).Unit |
| 318 | local upV = (Vector3.new(0,0,1) - Vector3.new(0,0,1):Dot(rightV)*rightV).Unit |
| 319 | local normalV = upV:Cross(rightV) |
| 320 | local pos = Vector3.new(0, 4, 0) |
| 321 | local cyl = Instance.new("Part") |
| 322 | cyl.Shape = Enum.PartType.Cylinder |
| 323 | cyl.Size = Vector3.new(0.8, 6, 6) |
| 324 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 325 | cyl.BrickColor = BrickColor.new("Bright violet") |
| 326 | cyl.Material = Enum.Material.Glacier |
| 327 | cyl.MaterialVariant = "2022 Stud" |
| 328 | cyl.Anchored = true; cyl.Parent = workspace |
| 329 | local cuts = {} |
| 330 | if #cuts > 0 then |
| 331 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 332 | for _, c in ipairs(cuts) do c:Destroy() end |
| 333 | if ok and result then |
| 334 | cyl:Destroy() |
| 335 | result.Name = "CandyBase"; result.Anchored = true; result.Parent = model |
| 336 | else |
| 337 | cyl.Name = "CandyBase"; cyl.Parent = model |
| 338 | end |
| 339 | else |
| 340 | cyl.Name = "CandyBase"; cyl.Parent = model |
| 341 | end |
| 342 | end |
| 343 | do |
| 344 | local rightV = Vector3.new(0.707107,0.707107,0).Unit |
| 345 | local upV = (Vector3.new(0,0,1) - Vector3.new(0,0,1):Dot(rightV)*rightV).Unit |
| 346 | local normalV = upV:Cross(rightV) |
| 347 | local pos = Vector3.new(0.113137, 3.88686, 0) |
| 348 | local cyl = Instance.new("Part") |
| 349 | cyl.Shape = Enum.PartType.Cylinder |
| 350 | cyl.Size = Vector3.new(1, 1.6, 1.6) |
| 351 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 352 | cyl.BrickColor = BrickColor.new("Magenta") |
| 353 | cyl.Material = Enum.Material.Glacier |
| 354 | cyl.MaterialVariant = "2022 Stud" |
| 355 | cyl.Anchored = true; cyl.Parent = workspace |
| 356 | local cuts = {} |
| 357 | if #cuts > 0 then |
| 358 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 359 | for _, c in ipairs(cuts) do c:Destroy() end |
| 360 | if ok and result then |
| 361 | cyl:Destroy() |
| 362 | result.Name = "Spiral1"; result.Anchored = true; result.Parent = model |
| 363 | else |
| 364 | cyl.Name = "Spiral1"; cyl.Parent = model |
| 365 | end |
| 366 | else |
| 367 | cyl.Name = "Spiral1"; cyl.Parent = model |
| 368 | end |
| 369 | end |
| 370 | do |
| 371 | local rightV = Vector3.new(0.707107,0.707107,0).Unit |
| 372 | local upV = (Vector3.new(0,0,1) - Vector3.new(0,0,1):Dot(rightV)*rightV).Unit |
| 373 | local normalV = upV:Cross(rightV) |
| 374 | local pos = Vector3.new(0, 4, 0.04) |
| 375 | local cyl = Instance.new("Part") |
| 376 | cyl.Shape = Enum.PartType.Cylinder |
| 377 | cyl.Size = Vector3.new(1.1, 3.6, 3.6) |
| 378 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 379 | cyl.BrickColor = BrickColor.new("Bright violet") |
| 380 | cyl.Material = Enum.Material.Glacier |
| 381 | cyl.MaterialVariant = "2022 Stud" |
| 382 | cyl.Anchored = true; cyl.Parent = workspace |
| 383 | local cuts = {} |
| 384 | local hole = Instance.new("Part") |
| 385 | hole.Shape = Enum.PartType.Cylinder |
| 386 | hole.Size = Vector3.new(1.3, 1.6, 1.6) |
| 387 | hole.CFrame = cyl.CFrame |
| 388 | hole.BrickColor = BrickColor.new("Bright violet") |
| 389 | hole.Material = Enum.Material.Glacier |
| 390 | hole.MaterialVariant = "2022 Stud" |
| 391 | hole.Anchored = true; hole.Parent = workspace |
| 392 | table.insert(cuts, hole) |
| 393 | local angBoxes = {} |
| 394 | do |
| 395 | local edgeDir = 1*rightV + 0*upV |
| 396 | local edgePerp = 0*rightV + 1*upV |
| 397 | local cut = Instance.new("Part") |
| 398 | cut.Size = Vector3.new(7.2, 1.3, 7.2) |
| 399 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 3.6 * edgePerp, edgeDir, normalV) |
| 400 | cut.BrickColor = BrickColor.new("Bright violet") |
| 401 | cut.Material = Enum.Material.Glacier |
| 402 | cut.MaterialVariant = "2022 Stud" |
| 403 | cut.Anchored = true; cut.Parent = workspace |
| 404 | table.insert(angBoxes, cut) |
| 405 | end |
| 406 | do |
| 407 | local edgeDir = 0*rightV + -1*upV |
| 408 | local edgePerp = 1*rightV + 0*upV |
| 409 | local cut = Instance.new("Part") |
| 410 | cut.Size = Vector3.new(7.2, 1.3, 7.2) |
| 411 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 3.6 * edgePerp, edgeDir, normalV) |
| 412 | cut.BrickColor = BrickColor.new("Bright violet") |
| 413 | cut.Material = Enum.Material.Glacier |
| 414 | cut.MaterialVariant = "2022 Stud" |
| 415 | cut.Anchored = true; cut.Parent = workspace |
| 416 | table.insert(angBoxes, cut) |
| 417 | end |
| 418 | do |
| 419 | local w = angBoxes[1]:IntersectAsync({angBoxes[2]}) |
| 420 | angBoxes[1]:Destroy(); angBoxes[2]:Destroy() |
| 421 | w.Anchored = true; w.Parent = workspace |
| 422 | table.insert(cuts, w) |
| 423 | end |
| 424 | if #cuts > 0 then |
| 425 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 426 | for _, c in ipairs(cuts) do c:Destroy() end |
| 427 | if ok and result then |
| 428 | cyl:Destroy() |
| 429 | result.Name = "Spiral2"; result.Anchored = true; result.Parent = model |
| 430 | else |
| 431 | cyl.Name = "Spiral2"; cyl.Parent = model |
| 432 | end |
| 433 | else |
| 434 | cyl.Name = "Spiral2"; cyl.Parent = model |
| 435 | end |
| 436 | end |
| 437 | do |
| 438 | local rightV = Vector3.new(0.707107,0.707107,0).Unit |
| 439 | local upV = (Vector3.new(0,0,1) - Vector3.new(0,0,1):Dot(rightV)*rightV).Unit |
| 440 | local normalV = upV:Cross(rightV) |
| 441 | local pos = Vector3.new(0, 4, 0) |
| 442 | local cyl = Instance.new("Part") |
| 443 | cyl.Shape = Enum.PartType.Cylinder |
| 444 | cyl.Size = Vector3.new(1, 5.6, 5.6) |
| 445 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 446 | cyl.BrickColor = BrickColor.new("Magenta") |
| 447 | cyl.Material = Enum.Material.Glacier |
| 448 | cyl.MaterialVariant = "2022 Stud" |
| 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(1.2, 3.6, 3.6) |
| 454 | hole.CFrame = cyl.CFrame |
| 455 | hole.BrickColor = BrickColor.new("Magenta") |
| 456 | hole.Material = Enum.Material.Glacier |
| 457 | hole.MaterialVariant = "2022 Stud" |
| 458 | hole.Anchored = true; hole.Parent = workspace |
| 459 | table.insert(cuts, hole) |
| 460 | local angBoxes = {} |
| 461 | do |
| 462 | local edgeDir = 0*rightV + 1*upV |
| 463 | local edgePerp = -1*rightV + 0*upV |
| 464 | local cut = Instance.new("Part") |
| 465 | cut.Size = Vector3.new(11.2, 1.2, 11.2) |
| 466 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 5.6 * edgePerp, edgeDir, normalV) |
| 467 | cut.BrickColor = BrickColor.new("Magenta") |
| 468 | cut.Material = Enum.Material.Glacier |
| 469 | cut.MaterialVariant = "2022 Stud" |
| 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(11.2, 1.2, 11.2) |
| 478 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 5.6 * edgePerp, edgeDir, normalV) |
| 479 | cut.BrickColor = BrickColor.new("Magenta") |
| 480 | cut.Material = Enum.Material.Glacier |
| 481 | cut.MaterialVariant = "2022 Stud" |
| 482 | cut.Anchored = true; cut.Parent = workspace |
| 483 | table.insert(angBoxes, cut) |
| 484 | end |
| 485 | do |
| 486 | local w = angBoxes[1]:IntersectAsync({angBoxes[2]}) |
| 487 | angBoxes[1]:Destroy(); angBoxes[2]:Destroy() |
| 488 | w.Anchored = true; w.Parent = workspace |
| 489 | table.insert(cuts, w) |
| 490 | end |
| 491 | if #cuts > 0 then |
| 492 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 493 | for _, c in ipairs(cuts) do c:Destroy() end |
| 494 | if ok and result then |
| 495 | cyl:Destroy() |
| 496 | result.Name = "Spiral3"; result.Anchored = true; result.Parent = model |
| 497 | else |
| 498 | cyl.Name = "Spiral3"; cyl.Parent = model |
| 499 | end |
| 500 | else |
| 501 | cyl.Name = "Spiral3"; cyl.Parent = model |
| 502 | end |
| 503 | end |
| 504 | model.PrimaryPart = model:FindFirstChild("Stick") |
| 505 | print("HalloweenLollipop built: " .. #model:GetChildren() .. " parts") |
Loading comments...