I am trying to move a model after it is placed in a spot but I keep getting an error message that says CFrame isn't a member of the model. I have also tried using Position instead of CFrame and it doesn't work either. Can anyone find what I'm doing wrong? To be clear, I am trying to move CSprout's position or CFrame by 10 studs in one direction, but the problem is it doesn't recognize CFrame. Thanks!
function Plant()
local seed = script.Parent:FindFirstChild("Wheatstalk")
local seed2 = script.Parent:FindFirstChild("Wheatstalk2")
local seed3 = script.Parent:FindFirstChild("Wheatstalk3")
local seed4 = script.Parent:FindFirstChild("Wheatstalk4")
local seed5 = script.Parent:FindFirstChild("Wheatstalk5")
local seed6 = script.Parent:FindFirstChild("Wheatstalk6")
local position = seed.Position
local name = "WheatSp2"
local Sprout = game.Lighting.Agriculture.Sprouts2:FindFirstChild(name)
local CSprout = Sprout:Clone()
local position = seed.Position
seed:remove()
seed2:remove()
seed3:remove()
seed4:remove()
seed5:remove()
seed6:remove()
CSprout.Parent = game.Workspace
CSprout:MoveTo(position)
CSprout:MakeJoints()
local x = CSprout.Wheatstalk.CFrame.x
local y = CSprout.Wheatstalk.CFrame.y
local z = CSprout.Wheatstalk.CFrame.z
CSprout:SetPrimaryPartCFrame(x + 10,y,z)
end
wait(20)
Plant()
print("planted")

1 comment
You can't use CFrame on a model. Either move the model with the MoveTo function, or use it's primary part CFrame.