So I've set up an infinite loop to clone a part in my server storage. The script is only creating one clone.
local object = game.ServerStorage.Part3 local partClone = object:Clone() local infinite = 1 repeat wait(2) partClone.Parent = game.Workspace partClone.Position = Vector3.new(-181.17, 28.53, -2.32) print("Test") until infinite == 0
I fixed the code by simply putting the variable in the repeat function.
local object = game.ServerStorage.Part3 local infinite = 1 repeat wait(2) local partClone = object:Clone() partClone.Parent = game.Workspace partClone.Position = Vector3.new(-181.17, 28.53, -2.32) print("Test") until infinite == 0
local npc = game.ReplicatedStorage.Name:Clone() npc.Parent = game.Workspace npc.Name = "CustomName"
You could do this it would be more simple
just a few small tweaks
object = game.ServerStorage.Part3 partClone = object:Clone() infinite = 1 repeat wait(2) partClone = object:Clone() infinite = infinite - 1 partClone.Parent = game.Workspace partClone.Position = Vector3.new(-181.17, 28.53, -2.32) print("Test") until infinite == 0
Why have you guys made it this hard! Just clone it and then easily move it to workspace
!
local object = game.ServerStorage.Part3 local partClone = object:Clone() --Clones part partClone.Name = "ClonedPart" --Put the name you want between the quotes. partClone.Parent = game.Workspace --Moves to workspace partClone.Position = Vector3.new(-181.17, 28.53, -2.32) --You've got this right!