Position cannot be assigned to

Code:

for num = 1,50 do
			
			print("Fire #" .. num .. " spawned")

			local ClonedFire = EventObjects:WaitForChild("Fire"):Clone()
			ClonedFire.Parent = workspace:WaitForChild("EventObjectStorage")

			local X = math.random(-97,97)

			local Z = math.random(-97,97)

			ClonedFire:PivotTo(CFrame.new(Vector3.new(X,0.5,Z)))

			if (ClonedFire.WorldPivot.Position - Vector3.new(0,0.5,0)).Magnitude < 12 then

				local ChosenSize = math.random(5,18)

				ClonedFire.WorldPivot.Position = ClonedFire.WorldPivot.Position * Vector3.new(0,15,15)

			end
			
			task.delay(10,function()

				workspace:WaitForChild("EventObjectStorage"):ClearAllChildren()

			end)
			
		end

The line that is causing the issue is the one that multiplies the vector3

I’m not sure that you can multiply two Vector3’s together like you can with CFrames. Try adding them.

You cannot edit Model.WorldPivot, use Model:PivotTo


You can

2 Likes