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

How do we Clone all children and position then in a random spawn position in a folder?

local SpawnedGuns = game.Workspace.Gunspawned
local gunSpawns = game.Workspace.GunSpawns:GetChildren() 
local gunsToSpawn = game.ServerStorage.Guns:GetChildren()

local CloneGuns = gunsToSpawn:Clone()
CloneGuns.Parent = SpawnedGuns
CloneGun.Position = math.Random("gunSpawns").Position 



--But I don't know whats wrong with this peace of code how do I fix it?

1 answer

Your ("gunSpawns") should be

math.Random[gunSpawns]Position -- Do not include the quotations.

1 comment

0

@Xx0966xX this is probably the solution to your problem. if it is, please mark this question as "Answered" by this person ^

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