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

Need help spawning model, setPrimaryPartCFrame error?

Asked by
pie9909 18
4 years ago

Okay so I managed to get PrimaryPart into my Model using


local ZAP = game.ServerStorage.KEffects.ZAP local PrimePart = game.ServerStorage.KEffects.PrimaryPart local ClonePrimePart = PrimePart:Clone() cloneZAP = ZAP:Clone() cloneZAP.Parent = game.Workspace.kEffect ClonePrimePart.Parent = game.Workspace.kEffect:WaitForChild("ZAP") --waiting for model cloneZAP.PrimaryPart = ZAP.PrimaryPart cloneZAP:SetPrimaryPartCFrame(CFrame.new(10,10,10))

But im still getting this error

Model:SetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.

what am I missing?

0
You need to set the PrimaryPart, not just add it. To do so, select the Model Object, click the "PrimaryPart" property, and then proceed to click the Instance you wish to designate. Ziffixture 6913 — 4y
0
Got it! pie9909 18 — 4y

1 answer

Log in to vote
0
Answered by
pie9909 18
4 years ago

Fixed it, I set the primary part in before spawning the part

and named the part PP since I was still getting an error when part was named PrimaryPart

    local ZAP = game.ServerStorage.KEffects.ZAP


    cloneZAP = ZAP:Clone()

    cloneZAP.PrimaryPart = cloneZAP.PP

    cloneZAP.Parent = game.Workspace.kEffect

    cloneZAP:SetPrimaryPartCFrame(CFrame.new(10,10,10))

Ad

Answer this question