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

Model-To-Script generator gives no output. Why?

Asked by 4 years ago
print([[
local model = Instance.new("Model",game.Workspace)
]])
local toconvert = game.Workspace["Observation Tower"]
local childrentable={}
local childrennumber=0
sentchildrentable=false
function mainloop(children)
for i=1,#children,1 do
    childrennumber=childrennumber+1
    wait()
    if i==#children then
    for i=1,#childrentable,1 do
        if sentchildrentable==false then
        wait(0.1)
    mainloop(childrentable[i]:GetChildren())
    sentchildrentable=true
    else
    if children[i]:IsA("Model")==false and children[i]:IsA("Folder")==false then
    print("local child"..childrennumber.."=Instance.new("..children[i].ClassName..",model)")
    else
    table.insert(childrentable,children[i])
end
end
end
end
end
end
local toconvertchildren = game.Workspace["Observation Tower"]:GetChildren()
mainloop(toconvertchildren,0)

It gives NO Output. doesn't error, doesn't print.

0
Format and I will consider answering RunKittenzRComin 170 — 4y
0
Or you could just answer it, instead of demanding that i format it to fit your needs. I can read that script easily. Void_Frost 571 — 4y
0
If you expect help, you have to make your code readable. It is hardly readable. Twinbrotato 543 — 4y
0
Could you please elaborate on what you are trying to achieve at least? Benbebop 1049 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

The reason it is not printing is because you have the function in Print. So If you wanted to do it. Simply just get the model and put the name as the script. If you wanted to print it which was your question which was not stated. Just upvote this, and Ill get back to you as soon as I can

0
The function isn't in print. Void_Frost 571 — 4y
Ad

Answer this question