So I'm currently working on a script, and for it I create a lantern. However, when assigning the parts of the lantern to vector3 positions it sets them all to 0, 0.7, 0 instead of the positions I set. It worked like 5 minutes ago, then I tried adding local variables to make it shorter, which broke it, then I changed it back to the way it was before and now it's doing this. What's wrong with it????
local workspace;
Instance.new("Model", game.Workspace)
game.Workspace.Model.Name = "Lantern"
Instance.new("Part", game.Workspace.Lantern)
game.Workspace.Lantern.Part.Name = "centerPart" --this whole block is spawning and naming parts
Instance.new("Part", game.Workspace.Lantern)
game.Workspace.Lantern.Part.Name = "topPart"
Instance.new("Part", game.Workspace.Lantern)
game.Workspace.Lantern.Part.Name = "bottomPart"
local lantern = game.Workspace.Lantern
lantern.centerPart.Size = Vector3.new(1, 1.5, 1)
lantern.centerPart.BrickColor = BrickColor.new(0,255,255)
lantern.centerPart.Material = Enum.Material.Neon
lantern.topPart.Size = Vector3.new(1.25, 0.125, 1.25) --this whole block is assigning properties to the parts
lantern.topPart.Material = Enum.Material.Pebble
lantern.bottomPart.Size = Vector3.new(1.25, 0.125, 1.25)
lantern.bottomPart.Material = Enum.Material.Pebble
lantern.centerPart.Position = Vector3.new(0, 0.875, 0)
lantern.topPart.Position = Vector3.new(0, 1.688, 0) --this whole block is setting part positions
lantern.bottomPart.Position = Vector3.new(0, 0.062, 0)
Instance.new("Weld", game.Workspace.Lantern.centerPart)
lantern.centerPart.Weld.Name = "Weld1"
lantern.centerPart.Weld1.Part1 = lantern.topPart
lantern.centerPart.Weld1.Part0 = lantern.centerPart
Instance.new("Weld", game.Workspace.Lantern.centerPart) --this block is adding welds
lantern.centerPart.Weld.Name = "Weld2"
lantern.centerPart.Weld2.Part1 = lantern.bottomPart
lantern.centerPart.Weld2.Part0 = lantern.centerPart

5 comments
(I added the entire script just in case it's a problem with something in it.)
Oh dear
Why not just make a model prior to that and clone it from ServerStorage instead of making a model via a script?
@RazzyPlayz I'm making all of it in one script because I'm planning to be able to run it on myself on a script builder game. I'm still new to scripting so if there's an easier way let me know lol. This lantern is going to be welded to a player.
i see tons of things raw