Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

cloning children on enter?

Trying to clone all the children into the model ds when it is loaded on enter, what's wrong?

	game.Players.PlayerAdded:connect(function(p)
	repeat wait() until p.ds
	for i,v in pairs(game.ServerStorage.ds:GetChildren()) do
	v:Clone().Parent = p.ds
	end
end)

@MistaLangston, edited the script but still not working

game.Players.PlayerAdded:connect(function(p)
p.Archivable = false	
if  p.Archivable == false then
repeat wait() until game:WaitForChild("ds")
local a = game.ServerStorage:WaitForChild("ds"):Clone()
a.Parent = p
wait(.1)
p.Archivable = true
end 
end)

1 answer

  --If this is what you want.
    game.Players.PlayerAdded:connect(function(p)
   if  p.Archivable = false then
   wait()
   p.Archivable = true 
  local a = p:Clone()
 a.Parent == game.ServerStorage.ds
end 
end)
 

1 comment

0

Didn't get it to work, check out my edit to the post maybe it'll help us get it fixed

This discussion is preserved as it was. New answers, comments, and votes are closed.