I have a Model (not ModelScript) this model contains a script, this script set the PrimaryPart. my problem is, when I clone the model, I need to use the function SetPrimaryPartCFrame(cframe), to position the model, like this:
local cframe = CFrame.new(0, 0, 0) --whatever position local name = "model name" local model = game.ReplicatedStorage:FindFirstChild(name):Clone() --at this point, the cloned script in the model is running, --but it's not finish --so the PrimaryPart of the model has not set model:SetPrimaryPartCFrame(cframe)
Now I got this error Model:SetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this., So my question is: how to wait until the script in the model finish?
Any help will be appreciated.
Locked by RubenKan
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?