Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 2 months ago
Edited 2 months ago
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

Log in to vote
1
Answered by 2 months ago

Your ("gunSpawns") should be

math.Random[gunSpawns]Position -- Do not include the quotations.
0
@Xx0966xX this is probably the solution to your problem. if it is, please mark this question as "Answered" by this person ^ Avoxea 43 — 2mo
Ad

Answer this question