Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I made a script to generate 2 parts, but its just not working. Any idea where I went wrong?

Asked by 4 years ago
01function PartGenerator(Name, Color, Material, Position)
02    local Part = Instance.new("Part")
03    Part.Name = Name
04    Part.Parent = workspace
05    Part.BrickColor = Color
06    Part.Material = Material
07    Part.Position = position
08    Part.Reflectance = 1
09    Part.Anchored = true
10    Part.CanCollide = true
11end
12 
13PartGenerator(Part1, BrickColor.new("Really red"),Enum.Material.Asphalt, Vector3.new(0,15,0))
14PartGenerator(Part2, BrickColor.new("Really blue"), Enum.Material.CrackedLava, Vector3.new(0,20,0))
2
you don't seem to be giving a string for the name parameter AntoninFearless 622 — 4y
1
Use a string. Also do Part.Position = Position instead of position. Dovydas1118 1495 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Hey there! I think you might have forgotten to make the name a string.

Line 13:

1PartGenerator("Part1", BrickColor.new("Really red"),Enum.Material.Asphalt, Vector3.new(0,15,0))

Line 14:

1PartGenerator("Part2", BrickColor.new("Really blue"), Enum.Material.CrackedLava, Vector3.new(0,20,0))

If this still doesn't work, please comment what errors the output is printing. :D

Ad

Answer this question