Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Model:SetPrimaryCFrame() failed because no PrimaryPart has been set?


When i run the script it comes up with "Model:SetPrimaryPartCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this. - Server - Script:7". I Have no idea how to fix this, any help ?

_G.deadzombies = 0

local ServerStorage = game:getService("ServerStorage")
local Zombie = ServerStorage:WaitForChild("Zombie")

local newZombie = Zombie:Clone()
newZombie:SetPrimaryPartCFrame(CFrame.new(10,10,10))
newZombie.Parent = game.Workspace.Zombiez

while wait(1) do
	if #game.Workspace.Zombiez:GetChildren() == 0 then
		for i = 0, _G.deadZombies, 1 do
			print("looping")
			local newZombie = Zombie:Clone()
			local myCFrame = game.Players.LocalPlaye
			newZombie:SetPrimaryPartCFrame(CFrame.new(math.random(1,100),10,math.random(1,100)))
			newZombie.Parent = game.Workspace.Zombiez
		end
	end
end

1 answer

Its telling you to set the Primary part of the model. To do that just click on the model, look in properties in Data their should be something called "Primary Part" click on that and select anywhere in the model such as the head and then it should work.

This discussion is preserved as it was. New answers, comments, and votes are closed.