Okay so i want to create a npc, i have the basic rig in serverscriptservice and i want to create it then add a players skin on to it but right now, the body doesnt even spawn anymore
while true do
if Spawned == false then
task.wait(1)
local player = Players:GetPlayerByUserId(1641989288)
if player then
Spawned = true
local character = player.Character or player.CharacterAdded:Wait()
local newNPC = ServerScriptService.NpcTemplate:Clone()
newNPC.Parent = Workspace
local humanoid = newNPC:FindFirstChildOfClass("Humanoid")
if humanoid then
if not humanoid:FindFirstChildOfClass("Animator") then
Instance.new("Animator", humanoid)
end
end
local hrp = newNPC:FindFirstChild("HumanoidRootPart")
if hrp then
hrp.CFrame = SpawnPart.CFrame + Vector3.new(0, 0, 0)
task.spawn(function()
MoveToTarget(newNPC, EndPart)
end)
end
task.wait(SpawnInterval)
else
warn("Player nil")
end
else
task.wait()
end
end```