Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this script for a part not doing anything?

Asked by 10 years ago

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

Log in to vote
1
Answered by 10 years ago

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

0
Thanks! I knew I was forgetting something obvious! :D Lightdrago 95 — 10y
0
Lol, it happens. I got so frustrated once because :Destroy() wasn't working when I forgot the () at the end. Orlando777 315 — 10y
Ad

Answer this question