Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

cloning children on enter?

Asked by
RoyMer 301 Moderation Voter
9 years ago

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

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

@MistaLangston, edited the script but still not working

01game.Players.PlayerAdded:connect(function(p)
02p.Archivable = false   
03if  p.Archivable == false then
04repeat wait() until game:WaitForChild("ds")
05local a = game.ServerStorage:WaitForChild("ds"):Clone()
06a.Parent = p
07wait(.1)
08p.Archivable = true
09end
10end)

1 answer

Log in to vote
0
Answered by 9 years ago
1  --If this is what you want.
2    game.Players.PlayerAdded:connect(function(p)
3   if  p.Archivable = false then
4   wait()
5   p.Archivable = true
6  local a = p:Clone()
7 a.Parent == game.ServerStorage.ds
8end
9end)
0
Didn't get it to work, check out my edit to the post maybe it'll help us get it fixed RoyMer 301 — 9y
Ad

Answer this question