Door is not working

I am new to developing. I am used a tutorial on how to make a working door. I copied everything and it says there is an error on line 5. I don’t see any error though.can someone help me

Make sure your Door variable is the model if you’re using the PrimaryPart of the model, the error means that it can’t find the part you’re trying to assign.

Instead of saying Door.PrimaryPart.CFrame, you need to use Door:SetPrimaryPartCFrame() to set the CFrame of the primary part, and Door:GetPrimaryPartCFrame() to get the CFrame of the primary part (which will allow you to add things to it, etc).

Look into this post on GetPrimaryPartCFrame() and this post on SetPrimaryPartCFrame() as they explain in detail how to use it.

It’s already there in the openDoor and closeDoor functions though. DoorData is just the door positions.

1 Like

Make sure u set the PrimaryPart

how do I do that? sorry I am a beginner

Select your door model and then in properties click on PrimaryPart then select the appropriate part (should be shown in the tutorial)

1 Like

thank you sooo much! It worked! appreciate it a lot!