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

Trying to spawn a bunch of parts over the map not working?

I made a script that is supposed to just spawn parts all over the map but it isn't working and there are no errors.

My script (server side script)

for i = 1,100 do
	local part = Instance.new('Part')
	part.Anchored = false
	part.CanCollide = true
	part.Position = Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
	wait()
end

2 answers

✓ Accepted answer

The issue you're having is very simple. You're creating the part, but never giving it a parent. To fix this, include this line in your loop. part.Parent = workspace

2 comments

0

Mention that the part should be parented last.

0

Thanks mythicalshade it works

You forgot to set the parent of the part to workspace, so it won't show.

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