Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Error code. Can not understand. ???lllllllllllllllllllllllllllllllll

Asked by 5 years ago

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)
0
is this on roblox studio? mewant_taco 17 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

As far as I can tell, your code is fine but you haven't set the PrimaryPart in your model, you can either do this in your code:

model.PrimaryPart = model.A_Part

or, you can set it manually in the workspace by clicking on your model, and where it says Primary Part in properties, click that and then a Part in your model.

Ad

Answer this question