for _,plr in pairs(target) do
if not plr.Character then continue end
if not plr.Character:FindFirstChild("Humanoid") then continue end
if plr.Character.Humanoid.Health == 0 then continue end
plr.Character:SetPrimaryPartCFrame((chosenSection.StartPlatform.CFrame)* CFrame.new(0, 8, 0))
end
Error:
Model:SetPrimaryPartCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.
I have set the model with primarypart but the script still doesn’t say it doesn’t have a primarypart, can anyone help me?
Make sure the PrimaryPart was set on the server-side. Although, if it’s a default character model, it should be set to the HumanoidRootPart automatically.
for _, plr in target do
local Character = plr.Character
if not Character then continue end
local Humanoid = Character:FindFirstChild("Humanoid")
if not Humanoid then continue end
if Humanoid.Health <= 0 then continue end
Character:PivotTo(chosenSection.StartPlatform.CFrame * CFrame.new(0, 8, 0))
end
I just came across this error, I came looking for an answer and I didn’t find anything that would help, but I did find out what it was. With the workspace’s StreamingEnabled property activated to optimize your map, it basically does not render blocks far from the player. and this can cause this error (in my case it was that) I hope I helped.