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

Why is this script for a part not doing anything?

I don't know if I forgot something or just plain screwed up. Here's the script right here:

x = 4
for i = 1,50 do
	part = Instance.new("Part")
	part.Position = Vector3.new(0,0,x)
	part.Size = Vector3.new(4,1,4)
	part.TopSurface = 0
			local x = x+4
		wait(.03)
end

1 answer

You forgot to assign the Parent, which would be workspace. Keep in mind Vector3's stack on top of each other, CFrame actually goes to the position you request. But you might need to anchor it, or else it'll spaz out.

x = 4
for i = 1,50 do
    part = Instance.new("Part",workspace)
    part.Position = Vector3.new(0,0,x)
    part.Size = Vector3.new(4,1,4)
    part.TopSurface = 0
            local x = x+4
        wait(.03)
end

2 comments

0

Thanks! I knew I was forgetting something obvious! :D

0

Lol, it happens. I got so frustrated once because :Destroy() wasn't working when I forgot the () at the end.

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