while true do Instance.new("Part", game.Workspace).Name = "Fred" game.Workspace.Fred.Anchored = true game.Workspace.Fred.CanCollide = false wait(1) end
--> Whenever the part is inserted, it will not anchor, but that is only on a "while true do" loop, when I remove the loop, it anchors just fine, but it only makes one?
Because you're making a new part in the Workspace with the same name each time, the game will not know what part you are referencing.
This should fix the problem:
a = 1/0 -- Variable equal to infinity for i = 1,a do -- A for loop that will go on forever, like the while part = Instance.new("Part",game.Workspace) part.Name = ("Part"..i) part.Anchored = true part.CanCollide = false wait(1) end
That's because you used it's name. The script will find the name, then anchor the part.
Then hen the loop repeats, it'll find the name, the old one, and even though there are 2 of them, it will anchor the one it finds, the first one
while wait(1) do local part = Instance.new("Part", game.Workspace) part.Name = "Fred" part.Anchored = true part.CanCollide = false end
You can use the Instance.new as a var, and that's how you would mess with it.