local Spawns = game.Workspace:FindFirstChild(Name).Spawns:GetChildren() -- Get (around 25 random spawns from a folder)
local SpawnLoc = math.random(1,#Spawns) --choose a random spawn
script.Parent.Parent.Parent.Parent.Parent.Character:MoveTo(SpawnLoc .Position)-- move player to random spawn(etc)
I know I could name each spawn with a number but that's inefficient and I could have 100s of spawns, is there any way that I could do this using math.random? Because the Name and number of spawns change each time so I cant create a table {} or name the spawns, any help? SpawnLoc is returned as a numberValue, when it needs to be an object from the "Spawns" variable ~Thx, Bubs

3 comments
I don't understand. Your code looks fine to me other than you not putting an actual name in the FindFirstChild call. Is there any error with your script or a reason why this method will not work? I probably just missed something.
well, math.random returns a number for a start, and all the spawns are called "Spawn" and all i need it do to is to spawn to a random one of those, but the SpawnLoc is a number, idk if it needs to be a string or something
I see. I got you.