So while watching a tutorial on instances, nothing would work, other than creating the Part.
Part = Instance.new("Part", game.Workspace) Part.anchored = true Part.BrickColor = BrickColor.new("Bright Red") Part.Material = Wood Part.Transparency = .5 Part.name = Mahogany
I tried playing around with it but it still wouldn't work. Am I doing something wrong?
This code will never get past line 2, because you tried to access a property that doesn't exist.
Now, you may be thinking "Wait, anchored
doesn't exist? wotttt???" and you'd be totally right. anchored
does not exist.
Anchored
does.
Lua is case-sensitive, so you have to be very diligent with your capitalization. Since the Anchored
property has a capital A, you must always use a capital A when accessing it.
Part.Anchored = true
You have the same problem on line 6. The Name
property has a capital N.
A slightly different error is made on line 4 and 6. You can never edit a property with just plain text, unless they're variables or something. Both theses properties are edited using strings. A string is just a collection of characters, surrounded by quotation marks.
Part.Material = "Wood" Part.Name = "Mahogany"