I am trying to make a script that spawns a brick in a certain place then make it move. The moving part of it isn't that important unless you have to change the entire script (I don't think you will but, if you have too). Here's the script I have so far:
while true do A = Instance.new("Part", workpsace) A.Anchored = true A.Position = -10, 318.4, -224 B = Instance.new("SpotLight", A) B.Brightness = 5 B.Range = 20 for loop = 1, 20 do A.CFrame = A.CFrame +Vector3.new(0.1, 0, 0) wait(0.05) end wait(5) A:remove() end
The problem being on Line 4 according to the output window. I tried brackets, and that is it. Open to any suggestions.
[Please forgive me for the tags, I didn't know what to class it as so I done the most relevant tags I could think of]
To set the Position of the part, you use Vector3.
while true do A = Instance.new("Part", Workspace) -- You spelled Workspace wrong. A.Anchored = true A.Position = Vector3.new(-10, 318.4, -224) -- Using vector3 B = Instance.new("SpotLight", A) B.Brightness = 5 B.Range = 20 for loop = 1, 20 do A.CFrame = A.CFrame * CFrame.new(0.1, 0, 0) -- You don't add a Vector3 to CFrame, you multiply with another CFrame. wait(0.05) end wait(5) A:remove() end