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
8 years ago

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

Log in to vote
0
Answered by 8 years ago
  --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)


0
Didn't get it to work, check out my edit to the post maybe it'll help us get it fixed RoyMer 301 — 8y
Ad

Answer this question