I am trying to make a cloning machine where the "clones" will spawn on a part named "Part" at every X time interval(eg. 3 secs). But it seems not be looping(the script).
local zombie = game:GetService("ServerStorage").AssortedCrystal115 local spawner = script.Parent wait(0.1) while true do wait(0.1) local zom = zombie:Clone() local root = zom.HumanoidRootPart root.CFrame = CFrame.new(spawner.Position) + Vector3.new(0,math.random(1,3),0) zom.Parent = workspace.Clones print("Assorted") end
Thanks.
Something you should do is revise your first line from
local zombie = game:GetService("ServerStorage").AssortedCrystal115
to this:
local storage = game:GetService("ServerStorage") local zombie = storage:WaitForChild("AssortedCrystal115")
Another thing I'd recommend is changing ServerStorage to ReplicatedStorage and moving your npc there (this isn't required, just recommended).