I want to spawn an NPC using my code only. What are the requirements to do this? What attributes must I set?
So far, I have tried something like this:
local humanoid = Instance.new("Humanoid")
humanoid.RigType = "R15"
but seems that nothing spawns.
The problem with your script is that you are only creating a new Humanoid object, not an actual model of an NPC. The script below uses an NPC model that is already made, then clones it into the workspace.
I'll assume that the properties that you want in the NPC are already set in the actual model.
local replicatedStorage = game:GetService('ReplicatedStorage') local npc = replicatedStorage:WaitForChild('NPC') local function cloneNPC() npc:Clone().Parent = workspace end cloneNPC() -- call this function whenever you want a new clone