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
function PartGenerator(Name, Color, Material, Position)
    local Part = Instance.new("Part")
    Part.Name = Name
    Part.Parent = workspace
    Part.BrickColor = Color
    Part.Material = Material
    Part.Position = position
    Part.Reflectance = 1
    Part.Anchored = true
    Part.CanCollide = true
end 

PartGenerator(Part1, BrickColor.new("Really red"),Enum.Material.Asphalt, Vector3.new(0,15,0))
PartGenerator(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:

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

Line 14:

PartGenerator("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