What do you want to achieve? Keep it simple and clear!
I’m simply trying to clone an NPC for testing purposes.
What is the issue? Include screenshots / videos if possible!
Code:
local serverStorage = game:GetService(“ServerStorage”)
local mob = serverStorage:FindFirstChild(“Rig”)
local clone = mob:Clone()
local testFolder = workspace.TestFolder
while true do
wait()
clone.Parent = testFolder
print("cloned character")
end
return
For some reason it not cloning, I have tried cloning it from ServerStorage into a folder which should parent it to workspace, but that didn’t work, so I tried testing on a part and that worked. Then, I tried putting the NPC and the script in workspace and cloning it and that still didn’t work, and the code outputs no errors.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have looked through some videos and Developer Forums, and still hasn’t been able to fix the problem.
local serverStorage = game:GetService(“ServerStorage”)
local mob = serverStorage:FindFirstChild(“Rig”)
local testFolder = workspace.TestFolder
while true do
wait()
local clone = mob:Clone()
clone.Parent = testFolder
print("cloned character")
end
First of all: I don’t know if this is fully done yet because this is probably not the most efficient way to do whatever you’re doing
Second: To solve your problem, this is what you should do:
local serverStorage = game:GetService(“ServerStorage”)
local mob = serverStorage:FindFirstChild(“Rig”)
local testFolder = workspace.TestFolder
while wait() do
local clone = mob:Clone()
clone.Parent = testFolder
print("cloned character")
end
You only cloned it once so it’s only spawning one.