Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

trying to make a model that moves, any help?

while true do
 wait(1)
 for i= 1, 200 do
  script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.3)
  wait()
 end 
 wait(1)
 for i= 1, 200 do
  script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, -0.3)
  wait()
 end 
end

is my script. when i test it, the output says:

19:43:22.226 - CFrame is not a valid member of Model any help?

1 answer

You can't set the CFrame of a model, you can only change the cframe of its primaryPart or componets, I would use :SetPrimaryPartCFrame for that.

Note:Remember to set a PrimaryPart to the model

while true do
 wait(1)
 for i= 1, 200 do
  script.Parent:SetPrimaryPartCFrame = script.Parent:SetPrimaryPartCFrame * CFrame.new(0, 0, 0.3)
  wait()
 end 
 wait(1)
 for i= 1, 200 do
  script.Parent:SetPrimaryPartCFrame = script.Parent:SetPrimaryPartCFrame * CFrame.new(0, 0, -0.3)
  wait()
 end 
end

This discussion is preserved as it was. New answers, comments, and votes are closed.