Loading model...
by Julio Lopez · 7/23/2026
Lua Script
| 1 | -- Generated with StudForge.org | AI-powered 3D models for Roblox |
| 2 | -- Model: TableLamp |
| 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 = "TableLamp" |
| 21 | model.Parent = workspace |
| 22 | |
| 23 | local variants = { |
| 24 | ["Cashmere"] = "2022 Stud", |
| 25 | ["Cork"] = "2022 Stud", |
| 26 | ["Gun metallic"] = "2022 Stud", |
| 27 | } |
| 28 | do |
| 29 | local p = Instance.new("Part") |
| 30 | p.Shape = Enum.PartType.Cylinder |
| 31 | p.Name = "Base" |
| 32 | p.Size = Vector3.new(0.5, 6, 6) |
| 33 | p.CFrame = CFrame.new(0, 0.25, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(90)) |
| 34 | p.BrickColor = BrickColor.new("Gun metallic") |
| 35 | p.Material = Enum.Material.Glacier |
| 36 | p.MaterialVariant = "2022 Stud" |
| 37 | p.Anchored = true |
| 38 | p.Parent = model |
| 39 | end |
| 40 | do |
| 41 | local p = Instance.new("Part") |
| 42 | p.Shape = Enum.PartType.Cylinder |
| 43 | p.Name = "Pole" |
| 44 | p.Size = Vector3.new(10, 0.6, 0.6) |
| 45 | p.CFrame = CFrame.new(0, 5.54, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(90)) |
| 46 | p.BrickColor = BrickColor.new("Gun metallic") |
| 47 | p.Material = Enum.Material.Glacier |
| 48 | p.MaterialVariant = "2022 Stud" |
| 49 | p.Anchored = true |
| 50 | p.Parent = model |
| 51 | end |
| 52 | do |
| 53 | local p = Instance.new("Part") |
| 54 | p.Name = "SupportX" |
| 55 | p.Size = Vector3.new(9.6, 0.2, 0.2) |
| 56 | p.CFrame = CFrame.new(0, 10.54, 0) |
| 57 | p.BrickColor = BrickColor.new("Gun metallic") |
| 58 | p.Material = Enum.Material.Glacier |
| 59 | p.MaterialVariant = "2022 Stud" |
| 60 | p.Anchored = true |
| 61 | p.Parent = model |
| 62 | end |
| 63 | do |
| 64 | local p = Instance.new("Part") |
| 65 | p.Name = "SupportZ" |
| 66 | p.Size = Vector3.new(0.2, 0.2, 9.6) |
| 67 | p.CFrame = CFrame.new(0, 10.5, 0) |
| 68 | p.BrickColor = BrickColor.new("Gun metallic") |
| 69 | p.Material = Enum.Material.Glacier |
| 70 | p.MaterialVariant = "2022 Stud" |
| 71 | p.Anchored = true |
| 72 | p.Parent = model |
| 73 | end |
| 74 | do |
| 75 | local p = Instance.new("Part") |
| 76 | p.Shape = Enum.PartType.Ball |
| 77 | p.Name = "Bulb" |
| 78 | p.Size = Vector3.new(2, 2, 2) |
| 79 | p.CFrame = CFrame.new(0, 11, 0) |
| 80 | p.BrickColor = BrickColor.new("Cool yellow") |
| 81 | p.Material = Enum.Material.Neon |
| 82 | p.Anchored = true |
| 83 | p.Parent = model |
| 84 | end |
| 85 | do |
| 86 | local p = Instance.new("Part") |
| 87 | p.Shape = Enum.PartType.Cylinder |
| 88 | p.Name = "InnerAmbientGlow" |
| 89 | p.Size = Vector3.new(7.8, 9.4, 9.4) |
| 90 | p.CFrame = CFrame.new(0, 11, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(90)) |
| 91 | p.BrickColor = BrickColor.new("Cool yellow") |
| 92 | p.Material = Enum.Material.Neon |
| 93 | p.Anchored = true |
| 94 | p.Parent = model |
| 95 | end |
| 96 | do |
| 97 | local p = Instance.new("Part") |
| 98 | p.Name = "Seam" |
| 99 | p.Size = Vector3.new(0.1, 8, 0.2) |
| 100 | p.CFrame = CFrame.new(5, 11, 0) |
| 101 | p.BrickColor = BrickColor.new("Cork") |
| 102 | p.Material = Enum.Material.Glacier |
| 103 | p.MaterialVariant = "2022 Stud" |
| 104 | p.Anchored = true |
| 105 | p.Parent = model |
| 106 | end |
| 107 | do |
| 108 | local rightV = Vector3.new(1,0,0).Unit |
| 109 | local upV = (Vector3.new(0,0,-1) - Vector3.new(0,0,-1):Dot(rightV)*rightV).Unit |
| 110 | local normalV = upV:Cross(rightV) |
| 111 | local pos = Vector3.new(0, 11.04, 0.04) |
| 112 | local cyl = Instance.new("Part") |
| 113 | cyl.Shape = Enum.PartType.Cylinder |
| 114 | cyl.Size = Vector3.new(8, 10, 10) |
| 115 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 116 | cyl.BrickColor = BrickColor.new("Cashmere") |
| 117 | cyl.Material = Enum.Material.Glacier |
| 118 | cyl.MaterialVariant = "2022 Stud" |
| 119 | cyl.Anchored = true; cyl.Parent = workspace |
| 120 | local cuts = {} |
| 121 | local hole = Instance.new("Part") |
| 122 | hole.Shape = Enum.PartType.Cylinder |
| 123 | hole.Size = Vector3.new(8.2, 9.6, 9.6) |
| 124 | hole.CFrame = cyl.CFrame |
| 125 | hole.BrickColor = BrickColor.new("Cashmere") |
| 126 | hole.Material = Enum.Material.Glacier |
| 127 | hole.MaterialVariant = "2022 Stud" |
| 128 | hole.Anchored = true; hole.Parent = workspace |
| 129 | table.insert(cuts, hole) |
| 130 | local angBoxes = {} |
| 131 | do |
| 132 | local edgeDir = 1*rightV + 0*upV |
| 133 | local edgePerp = 0*rightV + 1*upV |
| 134 | local cut = Instance.new("Part") |
| 135 | cut.Size = Vector3.new(20, 8.2, 20) |
| 136 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 10 * edgePerp, edgeDir, normalV) |
| 137 | cut.BrickColor = BrickColor.new("Cashmere") |
| 138 | cut.Material = Enum.Material.Glacier |
| 139 | cut.MaterialVariant = "2022 Stud" |
| 140 | cut.Anchored = true; cut.Parent = workspace |
| 141 | table.insert(angBoxes, cut) |
| 142 | end |
| 143 | do |
| 144 | local edgeDir = -1*rightV + 0*upV |
| 145 | local edgePerp = 0*rightV + -1*upV |
| 146 | local cut = Instance.new("Part") |
| 147 | cut.Size = Vector3.new(20, 8.2, 20) |
| 148 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 10 * edgePerp, edgeDir, normalV) |
| 149 | cut.BrickColor = BrickColor.new("Cashmere") |
| 150 | cut.Material = Enum.Material.Glacier |
| 151 | cut.MaterialVariant = "2022 Stud" |
| 152 | cut.Anchored = true; cut.Parent = workspace |
| 153 | table.insert(angBoxes, cut) |
| 154 | end |
| 155 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 156 | if #cuts > 0 then |
| 157 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 158 | for _, c in ipairs(cuts) do c:Destroy() end |
| 159 | if ok and result then |
| 160 | cyl:Destroy() |
| 161 | result.Name = "ShadeFront"; result.Anchored = true; result.Parent = model |
| 162 | else |
| 163 | cyl.Name = "ShadeFront"; cyl.Parent = model |
| 164 | end |
| 165 | else |
| 166 | cyl.Name = "ShadeFront"; cyl.Parent = model |
| 167 | end |
| 168 | end |
| 169 | do |
| 170 | local rightV = Vector3.new(1,0,0).Unit |
| 171 | local upV = (Vector3.new(0,0,-1) - Vector3.new(0,0,-1):Dot(rightV)*rightV).Unit |
| 172 | local normalV = upV:Cross(rightV) |
| 173 | local pos = Vector3.new(0, 11, 0) |
| 174 | local cyl = Instance.new("Part") |
| 175 | cyl.Shape = Enum.PartType.Cylinder |
| 176 | cyl.Size = Vector3.new(8, 10, 10) |
| 177 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 178 | cyl.BrickColor = BrickColor.new("Cashmere") |
| 179 | cyl.Material = Enum.Material.Glacier |
| 180 | cyl.MaterialVariant = "2022 Stud" |
| 181 | cyl.Anchored = true; cyl.Parent = workspace |
| 182 | local cuts = {} |
| 183 | local hole = Instance.new("Part") |
| 184 | hole.Shape = Enum.PartType.Cylinder |
| 185 | hole.Size = Vector3.new(8.2, 9.6, 9.6) |
| 186 | hole.CFrame = cyl.CFrame |
| 187 | hole.BrickColor = BrickColor.new("Cashmere") |
| 188 | hole.Material = Enum.Material.Glacier |
| 189 | hole.MaterialVariant = "2022 Stud" |
| 190 | hole.Anchored = true; hole.Parent = workspace |
| 191 | table.insert(cuts, hole) |
| 192 | local angBoxes = {} |
| 193 | do |
| 194 | local edgeDir = -1*rightV + 0*upV |
| 195 | local edgePerp = 0*rightV + -1*upV |
| 196 | local cut = Instance.new("Part") |
| 197 | cut.Size = Vector3.new(20, 8.2, 20) |
| 198 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 10 * edgePerp, edgeDir, normalV) |
| 199 | cut.BrickColor = BrickColor.new("Cashmere") |
| 200 | cut.Material = Enum.Material.Glacier |
| 201 | cut.MaterialVariant = "2022 Stud" |
| 202 | cut.Anchored = true; cut.Parent = workspace |
| 203 | table.insert(angBoxes, cut) |
| 204 | end |
| 205 | do |
| 206 | local edgeDir = 1*rightV + 0*upV |
| 207 | local edgePerp = 0*rightV + 1*upV |
| 208 | local cut = Instance.new("Part") |
| 209 | cut.Size = Vector3.new(20, 8.2, 20) |
| 210 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 10 * edgePerp, edgeDir, normalV) |
| 211 | cut.BrickColor = BrickColor.new("Cashmere") |
| 212 | cut.Material = Enum.Material.Glacier |
| 213 | cut.MaterialVariant = "2022 Stud" |
| 214 | cut.Anchored = true; cut.Parent = workspace |
| 215 | table.insert(angBoxes, cut) |
| 216 | end |
| 217 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 218 | if #cuts > 0 then |
| 219 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 220 | for _, c in ipairs(cuts) do c:Destroy() end |
| 221 | if ok and result then |
| 222 | cyl:Destroy() |
| 223 | result.Name = "ShadeBack"; result.Anchored = true; result.Parent = model |
| 224 | else |
| 225 | cyl.Name = "ShadeBack"; cyl.Parent = model |
| 226 | end |
| 227 | else |
| 228 | cyl.Name = "ShadeBack"; cyl.Parent = model |
| 229 | end |
| 230 | end |
| 231 | do |
| 232 | local rightV = Vector3.new(1,0,0).Unit |
| 233 | local upV = (Vector3.new(0,0,-1) - Vector3.new(0,0,-1):Dot(rightV)*rightV).Unit |
| 234 | local normalV = upV:Cross(rightV) |
| 235 | local pos = Vector3.new(0, 15.06, 0.08) |
| 236 | local cyl = Instance.new("Part") |
| 237 | cyl.Shape = Enum.PartType.Cylinder |
| 238 | cyl.Size = Vector3.new(0.2, 10.1, 10.1) |
| 239 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 240 | cyl.BrickColor = BrickColor.new("Cork") |
| 241 | cyl.Material = Enum.Material.Glacier |
| 242 | cyl.MaterialVariant = "2022 Stud" |
| 243 | cyl.Anchored = true; cyl.Parent = workspace |
| 244 | local cuts = {} |
| 245 | local hole = Instance.new("Part") |
| 246 | hole.Shape = Enum.PartType.Cylinder |
| 247 | hole.Size = Vector3.new(0.4, 9.5, 9.5) |
| 248 | hole.CFrame = cyl.CFrame |
| 249 | hole.BrickColor = BrickColor.new("Cork") |
| 250 | hole.Material = Enum.Material.Glacier |
| 251 | hole.MaterialVariant = "2022 Stud" |
| 252 | hole.Anchored = true; hole.Parent = workspace |
| 253 | table.insert(cuts, hole) |
| 254 | local angBoxes = {} |
| 255 | do |
| 256 | local edgeDir = 1*rightV + 0*upV |
| 257 | local edgePerp = 0*rightV + 1*upV |
| 258 | local cut = Instance.new("Part") |
| 259 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 260 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 10.1 * edgePerp, edgeDir, normalV) |
| 261 | cut.BrickColor = BrickColor.new("Cork") |
| 262 | cut.Material = Enum.Material.Glacier |
| 263 | cut.MaterialVariant = "2022 Stud" |
| 264 | cut.Anchored = true; cut.Parent = workspace |
| 265 | table.insert(angBoxes, cut) |
| 266 | end |
| 267 | do |
| 268 | local edgeDir = -1*rightV + 0*upV |
| 269 | local edgePerp = 0*rightV + -1*upV |
| 270 | local cut = Instance.new("Part") |
| 271 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 272 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 10.1 * edgePerp, edgeDir, normalV) |
| 273 | cut.BrickColor = BrickColor.new("Cork") |
| 274 | cut.Material = Enum.Material.Glacier |
| 275 | cut.MaterialVariant = "2022 Stud" |
| 276 | cut.Anchored = true; cut.Parent = workspace |
| 277 | table.insert(angBoxes, cut) |
| 278 | end |
| 279 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 280 | if #cuts > 0 then |
| 281 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 282 | for _, c in ipairs(cuts) do c:Destroy() end |
| 283 | if ok and result then |
| 284 | cyl:Destroy() |
| 285 | result.Name = "TrimTopF"; result.Anchored = true; result.Parent = model |
| 286 | else |
| 287 | cyl.Name = "TrimTopF"; cyl.Parent = model |
| 288 | end |
| 289 | else |
| 290 | cyl.Name = "TrimTopF"; cyl.Parent = model |
| 291 | end |
| 292 | end |
| 293 | do |
| 294 | local rightV = Vector3.new(1,0,0).Unit |
| 295 | local upV = (Vector3.new(0,0,-1) - Vector3.new(0,0,-1):Dot(rightV)*rightV).Unit |
| 296 | local normalV = upV:Cross(rightV) |
| 297 | local pos = Vector3.new(0, 15.06, -0.04) |
| 298 | local cyl = Instance.new("Part") |
| 299 | cyl.Shape = Enum.PartType.Cylinder |
| 300 | cyl.Size = Vector3.new(0.2, 10.1, 10.1) |
| 301 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 302 | cyl.BrickColor = BrickColor.new("Cork") |
| 303 | cyl.Material = Enum.Material.Glacier |
| 304 | cyl.MaterialVariant = "2022 Stud" |
| 305 | cyl.Anchored = true; cyl.Parent = workspace |
| 306 | local cuts = {} |
| 307 | local hole = Instance.new("Part") |
| 308 | hole.Shape = Enum.PartType.Cylinder |
| 309 | hole.Size = Vector3.new(0.4, 9.5, 9.5) |
| 310 | hole.CFrame = cyl.CFrame |
| 311 | hole.BrickColor = BrickColor.new("Cork") |
| 312 | hole.Material = Enum.Material.Glacier |
| 313 | hole.MaterialVariant = "2022 Stud" |
| 314 | hole.Anchored = true; hole.Parent = workspace |
| 315 | table.insert(cuts, hole) |
| 316 | local angBoxes = {} |
| 317 | do |
| 318 | local edgeDir = -1*rightV + 0*upV |
| 319 | local edgePerp = 0*rightV + -1*upV |
| 320 | local cut = Instance.new("Part") |
| 321 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 322 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 10.1 * edgePerp, edgeDir, normalV) |
| 323 | cut.BrickColor = BrickColor.new("Cork") |
| 324 | cut.Material = Enum.Material.Glacier |
| 325 | cut.MaterialVariant = "2022 Stud" |
| 326 | cut.Anchored = true; cut.Parent = workspace |
| 327 | table.insert(angBoxes, cut) |
| 328 | end |
| 329 | do |
| 330 | local edgeDir = 1*rightV + 0*upV |
| 331 | local edgePerp = 0*rightV + 1*upV |
| 332 | local cut = Instance.new("Part") |
| 333 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 334 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 10.1 * edgePerp, edgeDir, normalV) |
| 335 | cut.BrickColor = BrickColor.new("Cork") |
| 336 | cut.Material = Enum.Material.Glacier |
| 337 | cut.MaterialVariant = "2022 Stud" |
| 338 | cut.Anchored = true; cut.Parent = workspace |
| 339 | table.insert(angBoxes, cut) |
| 340 | end |
| 341 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 342 | if #cuts > 0 then |
| 343 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 344 | for _, c in ipairs(cuts) do c:Destroy() end |
| 345 | if ok and result then |
| 346 | cyl:Destroy() |
| 347 | result.Name = "TrimTopB"; result.Anchored = true; result.Parent = model |
| 348 | else |
| 349 | cyl.Name = "TrimTopB"; cyl.Parent = model |
| 350 | end |
| 351 | else |
| 352 | cyl.Name = "TrimTopB"; cyl.Parent = model |
| 353 | end |
| 354 | end |
| 355 | do |
| 356 | local rightV = Vector3.new(1,0,0).Unit |
| 357 | local upV = (Vector3.new(0,0,-1) - Vector3.new(0,0,-1):Dot(rightV)*rightV).Unit |
| 358 | local normalV = upV:Cross(rightV) |
| 359 | local pos = Vector3.new(0, 7.06, 0.08) |
| 360 | local cyl = Instance.new("Part") |
| 361 | cyl.Shape = Enum.PartType.Cylinder |
| 362 | cyl.Size = Vector3.new(0.2, 10.1, 10.1) |
| 363 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 364 | cyl.BrickColor = BrickColor.new("Cork") |
| 365 | cyl.Material = Enum.Material.Glacier |
| 366 | cyl.MaterialVariant = "2022 Stud" |
| 367 | cyl.Anchored = true; cyl.Parent = workspace |
| 368 | local cuts = {} |
| 369 | local hole = Instance.new("Part") |
| 370 | hole.Shape = Enum.PartType.Cylinder |
| 371 | hole.Size = Vector3.new(0.4, 9.5, 9.5) |
| 372 | hole.CFrame = cyl.CFrame |
| 373 | hole.BrickColor = BrickColor.new("Cork") |
| 374 | hole.Material = Enum.Material.Glacier |
| 375 | hole.MaterialVariant = "2022 Stud" |
| 376 | hole.Anchored = true; hole.Parent = workspace |
| 377 | table.insert(cuts, hole) |
| 378 | local angBoxes = {} |
| 379 | do |
| 380 | local edgeDir = 1*rightV + 0*upV |
| 381 | local edgePerp = 0*rightV + 1*upV |
| 382 | local cut = Instance.new("Part") |
| 383 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 384 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 10.1 * edgePerp, edgeDir, normalV) |
| 385 | cut.BrickColor = BrickColor.new("Cork") |
| 386 | cut.Material = Enum.Material.Glacier |
| 387 | cut.MaterialVariant = "2022 Stud" |
| 388 | cut.Anchored = true; cut.Parent = workspace |
| 389 | table.insert(angBoxes, cut) |
| 390 | end |
| 391 | do |
| 392 | local edgeDir = -1*rightV + 0*upV |
| 393 | local edgePerp = 0*rightV + -1*upV |
| 394 | local cut = Instance.new("Part") |
| 395 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 396 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 10.1 * edgePerp, edgeDir, normalV) |
| 397 | cut.BrickColor = BrickColor.new("Cork") |
| 398 | cut.Material = Enum.Material.Glacier |
| 399 | cut.MaterialVariant = "2022 Stud" |
| 400 | cut.Anchored = true; cut.Parent = workspace |
| 401 | table.insert(angBoxes, cut) |
| 402 | end |
| 403 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 404 | if #cuts > 0 then |
| 405 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 406 | for _, c in ipairs(cuts) do c:Destroy() end |
| 407 | if ok and result then |
| 408 | cyl:Destroy() |
| 409 | result.Name = "TrimBotF"; result.Anchored = true; result.Parent = model |
| 410 | else |
| 411 | cyl.Name = "TrimBotF"; cyl.Parent = model |
| 412 | end |
| 413 | else |
| 414 | cyl.Name = "TrimBotF"; cyl.Parent = model |
| 415 | end |
| 416 | end |
| 417 | do |
| 418 | local rightV = Vector3.new(1,0,0).Unit |
| 419 | local upV = (Vector3.new(0,0,-1) - Vector3.new(0,0,-1):Dot(rightV)*rightV).Unit |
| 420 | local normalV = upV:Cross(rightV) |
| 421 | local pos = Vector3.new(0, 7.06, -0.04) |
| 422 | local cyl = Instance.new("Part") |
| 423 | cyl.Shape = Enum.PartType.Cylinder |
| 424 | cyl.Size = Vector3.new(0.2, 10.1, 10.1) |
| 425 | cyl.CFrame = CFrame.fromMatrix(pos, normalV, rightV) |
| 426 | cyl.BrickColor = BrickColor.new("Cork") |
| 427 | cyl.Material = Enum.Material.Glacier |
| 428 | cyl.MaterialVariant = "2022 Stud" |
| 429 | cyl.Anchored = true; cyl.Parent = workspace |
| 430 | local cuts = {} |
| 431 | local hole = Instance.new("Part") |
| 432 | hole.Shape = Enum.PartType.Cylinder |
| 433 | hole.Size = Vector3.new(0.4, 9.5, 9.5) |
| 434 | hole.CFrame = cyl.CFrame |
| 435 | hole.BrickColor = BrickColor.new("Cork") |
| 436 | hole.Material = Enum.Material.Glacier |
| 437 | hole.MaterialVariant = "2022 Stud" |
| 438 | hole.Anchored = true; hole.Parent = workspace |
| 439 | table.insert(cuts, hole) |
| 440 | local angBoxes = {} |
| 441 | do |
| 442 | local edgeDir = -1*rightV + 0*upV |
| 443 | local edgePerp = 0*rightV + -1*upV |
| 444 | local cut = Instance.new("Part") |
| 445 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 446 | cut.CFrame = CFrame.fromMatrix(pos + -1 * 10.1 * edgePerp, edgeDir, normalV) |
| 447 | cut.BrickColor = BrickColor.new("Cork") |
| 448 | cut.Material = Enum.Material.Glacier |
| 449 | cut.MaterialVariant = "2022 Stud" |
| 450 | cut.Anchored = true; cut.Parent = workspace |
| 451 | table.insert(angBoxes, cut) |
| 452 | end |
| 453 | do |
| 454 | local edgeDir = 1*rightV + 0*upV |
| 455 | local edgePerp = 0*rightV + 1*upV |
| 456 | local cut = Instance.new("Part") |
| 457 | cut.Size = Vector3.new(20.2, 0.4, 20.2) |
| 458 | cut.CFrame = CFrame.fromMatrix(pos + 1 * 10.1 * edgePerp, edgeDir, normalV) |
| 459 | cut.BrickColor = BrickColor.new("Cork") |
| 460 | cut.Material = Enum.Material.Glacier |
| 461 | cut.MaterialVariant = "2022 Stud" |
| 462 | cut.Anchored = true; cut.Parent = workspace |
| 463 | table.insert(angBoxes, cut) |
| 464 | end |
| 465 | for _, b in ipairs(angBoxes) do table.insert(cuts, b) end |
| 466 | if #cuts > 0 then |
| 467 | local ok, result = pcall(function() return cyl:SubtractAsync(cuts) end) |
| 468 | for _, c in ipairs(cuts) do c:Destroy() end |
| 469 | if ok and result then |
| 470 | cyl:Destroy() |
| 471 | result.Name = "TrimBotB"; result.Anchored = true; result.Parent = model |
| 472 | else |
| 473 | cyl.Name = "TrimBotB"; cyl.Parent = model |
| 474 | end |
| 475 | else |
| 476 | cyl.Name = "TrimBotB"; cyl.Parent = model |
| 477 | end |
| 478 | end |
| 479 | model.PrimaryPart = model:FindFirstChild("Base") |
| 480 | print("TableLamp built: " .. #model:GetChildren() .. " parts") |
Loading comments...