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

A Clone() Problem?

This is the current function that i use to place my maps. How do i make it more secure? Sometimes it does not even load parts (walls) anything more secure? Or just plain efficient?

function AddField()
Fields = Game.ServerStorage.Fields
Chosen = Game.Workspace.Chosen 
Randomize = Fields:GetChildren()
Picking = Randomize[math.random(1,#Randomize)]
Chosen.Value = Picking.Name
FieldAdd = Game.ServerStorage.Fields:FindFirstChild(Chosen.Value)
FieldAdd:Clone().Parent = Game.Workspace
FieldAdd:MakeJoints()
end

3 answers

✓ Accepted answer
function AddField()
Fields = Game.ServerStorage.Fields
Chosen = Game.Workspace.Chosen 
Randomize = Fields:GetChildren()
Picking = Randomize[math.random(1,#Randomize)]
Chosen.Value = Picking.Name
FieldAdd = Game.ServerStorage.Fields:FindFirstChild(Chosen.Value):Clone()
FieldAdd.Parent = Game.Workspace
FieldAdd:MakeJoints()
end

Try this...

2 comments

0

That's the same thing though?

0

no its not... you were adding welds to the Model in ServerStorage this Sould work TRUST me

It makes it connect to the original model so try parenting it to something like so:

function AddField()
Fields = Game.ServerStorage.Fields
Chosen = Game.Workspace.Chosen 
Randomize = Fields:GetChildren()
Picking = Randomize[math.random(1,#Randomize)]
Chosen.Value = Picking.Name
FieldAdd = Game.ServerStorage.Fields:FindFirstChild(Chosen.Value):Clone()
FieldAdd.Parent = Game.Workspace
FieldAdd:MakeJoints()
end

No I did not take other dude's I just have same answer because there isn't much more I know to clone

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