The model in the tutorial requires at least 2 parts: The main part for how the door looks and the “Hinge” part that the door rotates around. You should make something like this instead:
Notice how I have a part called “Hinge”. You should reference the part underneath the model like so:
local door = script.Parent
local hinge = door:WaitForChild("Hinge")
I just realized that the tutorial you’re following uses RunService to open its doors. You shouldn’t rely on that behavior. Instead, just use the TweenService and welds.
You don’t really need an Angle instance. You can do this instead. Note that this method requires the door to be welded to the hinge part. You can do this using a WeldConstraint or find a Weld plugin online.
local TweenService = game:GetService("TweenService")
local self = script.Parent
local hinge = self:WaitForChild("Hinge")
local angle = 90
local doorInfo = TweenInfo.new()
local doorOpen = TweenService:Create(hinge, doorInfo, {CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(angle), 0)})
local doorClose = TweenService:Create(hinge, doorInfo, {CFrame = hinge.CFrame})
task.wait(3)
doorOpen:Play()
task.wait(3)
doorClose:Play()
local TweenService = game:GetService("TweenService")
local self = script.Parent
local hinge = self:WaitForChild("Hinge")
local angle = 90
local doorInfo = TweenInfo.new()
local doorOpen = TweenService:Create(hinge,doorInfo,{CFrame = hinge.CFrame * CFrame.Angles(0,math.rad(angle),0)})
local doorClose = TweenService:Create(hinge,doorInfo,{CFrame = hinge.CFrame})
task.wait(3)
doorOpen:Play()
task.wait(3)
doorClose:Play()
I have followed your step but it dint give me any errors this time but the door dint move at all