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

Which is the best way to load every object in the game?

I would like to hear your opinion!

My opinion is to use :WaitForChild.

Example:

local part = workspace:WaitForChild("Part")
local part2 = workspace:WaitForChild("Part2")
local part3 = workspace:WaitForChild("Part3")

if part then
	if part 2 then
		if part 3 then
	print("Objects Loaded")
end

--btw the parts are supposed to be in ReplicatedStorage and be loaded by a script
--the only reason why I put all of those in an if statement and did not check the parts seperately is that the scripts run from the top to the bottom and cause it saves time.

Another way I know is that you put all the objects in the workspace and just change their CFrame to the position you want.

Let me know what do you think the best way is.

1 answer

✓ Accepted answer

Hello, 3chars20!

For me, it's create a folder on Server Storage and use a for loop to change the Parent of the Parts

Like:

for i,v in pairs(game.ReplicatedStorage.ToLoad:GetChildren()) do
	v.Parent = game.Workspace
end

This would move everithing from the folder ToLoad from replicated store to the workspace

Hope this helps

Good Luck with your games!!!

2 comments

0

That is a really nice method!!

0

I know, you can also filter for parts using this method

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