How would I clone a part into workspace from server storage?

What does it say on the output? Maybe its anchored?

I tried it anchored and unanchored. And theres nothing in the output.

Oh oops, I am missing something again, you are suppose to put Vector3.new(0, 0, i + 5) so that for every loop it will add the integer with 5.

Now it just dissapears.

30 charsssssssssss

Set 100 to like 10 or 5 so that you can see it moving. Also, if you want the bone to shoot out of the narrow then you will need to do basic math.

If I want to use the move script, the spawn script won’t work.

You can use spawn(function() so that other threads can run or you could use coroutines:

If I add the spawn, it doesn’t move.

Wait oh, the while loop will keep running no matter what so you will need to make it run after it has spawned so maybe make a boolean value to check whether it has spawned and then if it does make the while loop run. Send me the moving script by the way.

I thought this was the moving script How would I clone a part into workspace from server storage? - #27 by Abroxus

I mean send me the whole code so that I can organize and describe it all for you.

heres the spawn code

while true do

local BoneSpawn = game.ServerStorage.BoneSpawn:Clone()

BoneSpawn.Parent = workspace 

wait(5)


	BoneSpawn:Destroy()
end

and here is the move code


spawn(function()
workspace.BoneSpawn.PrimaryPart = workspace.BoneSpawn.Center

while true do
	for i = 1,100 do 
		
		
		workspace.BoneSpawn:SetPrimaryPartCFrame(CFrame.new(workspace.BoneSpawn.PrimaryPart.Position + Vector3.new(0,0,1)))
	end
      wait() -- add a wait to the while loop so it does not crash the game 
end

	end

Both codes are in separate scripts

Yeah just make one script and add the following code:


local Created = false

local SpawnBone = coroutine.create(function() -- I am creating a coroutine so that we can handle threads

while true do

local BoneSpawn = game.ServerStorage.BoneSpawn:Clone()

BoneSpawn.Parent = workspace 

Created = true
wait(20) -- wait for 20 seconds before making the bonespawn disappear


	BoneSpawn:Destroy()
Created = false
wait()
end

end)


local MoveBoneSpawn = coroutine.create(function()

workspace.BoneSpawn.PrimaryPart = workspace.BoneSpawn.Center

while true do
      if Created == true then -- checks whether the bonespawn exists
	for i = 1,100 do 
		
workspace.BoneSpawn:SetPrimaryPartCFrame(CFrame.new(workspace.BoneSpawn.PrimaryPart.Position + Vector3.new(0,0,i +1)))
end
      
else
  return
 end
    wait()
end

	end)

coroutine.resume(SpawnBone)
coroutine.resume(MoveBoneSpawn)

I apologise if this is messy since I am typing this on mobile.

Where do I put the model for it to work? It doesn’t seem to work in workspace neither server storage.

Put it into ServerStorage because we are going to clone it.

it doesn’t seem to be spawning. Nothing is in the output.