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

How to clone Folders with Models from Replicated Storage to a specific location in Workspace?

Asked by 4 years ago

Hi!

Trying to launch a remote event that will grab all the models inside a Folder in ReplicatedStorage, and place it in Workspace, in a certain position.

PersonalPlaceLoad.OnServerEvent:Connect(function(Plr, Location)
-- Grabbing the first single part from the Folder, no problem
local Place= game.ReplicatedStorage.Folder.Place:Clone()
Place.Parent = workspace.PlaceHolder
Place.Name = Plr.Name
Place.Position = Location

wait()
local Stuff = game.ReplicatedStorage.Folder.OtherPlace.OtherParts:Clone()
Stuff.Parent = Place

-- Items successfully clone from the ReplicatedStorage to the Folder in Workspace without a problem, but now I want to make sure that the Position of those parts are in the correct place, there are multiple parts in this Folder and want to bulk move instead of labeling each individual part.
local StuffNew = Stuff:GetChildren() -- I think this is the line where I'm doing it incorrectly?
StuffNew.Position = Location + Vector3.new(0,10,0)

end)

I can grab parts individually and move them of course, but I want to grab the bulk of the items and move them to a specific place, and not just where they drop out from the ReplicatedStorage.

Help please? :) Thanks.

0
I don't think you can grab everything at once. PrismaticFruits 842 — 4y
0
That would be very unfortunate if so. Any workarounds? Never2Humble 90 — 4y
1
You can Clone multiple items and move them from ReplicatedStorage to workspace, and they will be right in the place they were in before. If you have a module at Vector3.new(100, 10, 100) and you put it in ReplicatedStorage, upon cloning and parenting to workspace, it would be right back there. MrLonely1221 701 — 4y
1
StuffNew is a table, not a userdata DeceptiveCaster 3761 — 4y
View all comments (5 more)
0
Right, I do not want it to be at Vector3.new(100,100,100), but upon cloning it to workspace, being able to move the contents to a new spot, all at once without having to go through and call each individual part. Some form of "Get everything in Folder, move vector3.new(0,100,0)." Is that possible? Never2Humble 90 — 4y
0
I just said it's not a userdata. Doing StuffNew.Position creates a new value called Position that inherits the Vector3 that you're giving it. None of the parts in the table have their Position changed by doing this. DeceptiveCaster 3761 — 4y
0
Yes, thats why I asked HOW I could change the position of everything in StuffNew, or just Stuff to Location. Never2Humble 90 — 4y
1
Run a generic for loop through it and check to see if each userdata it comes across is a BasePart. DeceptiveCaster 3761 — 4y
0
Hi, thanks for the response,I figured it out. :) Never2Humble 90 — 4y

Answer this question