How can i wait for parts/baseparts to load into the game before continuing the script

to make things simple;
when the map loads it has alot of baseparts and it takes awhile for them all to load and appear in the game
usually when the map is selected the games waits one second before teleporting the players
if the map isnt loaded yet the players just fall to the void

local yourModel = game.Workspace:WaitForChild(“yourModel”)
local yourPart = yourModel:WaitForChild(“yourPart”)

the parts are always different, so far theres 2 maps to be randomly picked from and they will always be placed into game.workspace.ChosenMap
if this wasnt what you were after then idk

each map is a folder with atleast 4, one is called GameParts another is called Map and one is called Lighting and a folder called Teleports

You could use CollectionService and tag all of the parts you want to wait for.

the map is always defined in a variable in the gamehandler so the game always knows what the current map is

ill have a look at it and try smth

In that case, you could use conditional subroutines to change how you refer to the parts, depending on which map it is.

Or create an array of the parts you need to wait for, searching through the map for the specific parts

I mean you could just use PreloadAsync here, right? It’ll make sure each part loads, and it’ll yield the script until it’s done.

ok then ill check that out rlq

perfect, now it waits for everything in the map folder to load until continuing!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.