7: invalid argument #3 (CFrame expected, got Vector3)

Hello, so I’m trying to make a script that will clone a pad 10 times and each time add some space between each pad I wrote this script but it’s not working, it gives me this error:
7: invalid argument #3 (CFrame expected, got Vector3)
Here is my script:

local temp = game.ReplicatedStorage:WaitForChild('TemplatePad')

wait(10)

for i = 1, 10 do

local clonedpad = temp:Clone()

clonedpad.Parent = script.Parent

local pos = Vector3.new(temp.Size.X/2,0,0) + temp.Position

clonedpad.CFrame = pos

end

How can I do this?

Thank you!

You are assigning a Vector3 value to the .CFrame property, whereas it expects a CFrame value. I believe, You should assign it to the .Position property instead:

clonedpad.Position = pos
1 Like

you are trying set a cframe as a vector3,
change it to

clonepad.CFrame = CFrame.new(pos)