I've been trying to make an animated door with Tween Service or whatever you call it but I continue to get the same error: ServerScriptService.Script:9: attempt to index nil with 'CFrame'
local TweenService = game:GetService("TweenService") local door = workspace.Door local DoorRoot = door.PrimaryPart local DoorSwingInfo = TweenInfo.new() local DoorSwingTween = TweenService:Create(doorRoot, DoorSwingInfo, { CFrame = doorRoot.CFrame * CFrame.Angles(0, math.rad(95), 0) }) wait(5) DoorSwingTween:Play()
Try this
local TweenService = game:GetService("TweenService") local door = workspace.Door local DoorRoot = door.PrimaryPart local DoorSwingInfo = TweenInfo.new() local goal = {} goal.CFrame = DoorRoot.CFrame * CFrame.Angles(0, math.rad(95), 0) local DoorSwingTween = TweenService:Create(DoorRoot, DoorSwingInfo, goal) wait(5) DoorSwingTween:Play()