I have an error, I do not know how to solve it. Help me please.
The error itself:
Model:GetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.
local Parent = script.Parent
local Config = Parent.Config
local Enabled = Config.Enabled
local model = Parent
local function DoorAnimation()
if not Enabled.Value then
Enabled.Value = true
for i = 0, 17 do
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.Angles(0, 0.1, 0))
wait()
end
wait(2)
for i = 0, 17 do
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.Angles(0, 0.1, 0))
wait()
end
Enabled.Value = false
end
end
Config.DetectEvent.OnServerEvent:Connect(DoorAnimation)

1 comment
is this on roblox studio?