diff --git a/src/main.rs b/src/main.rs index 4a0a142..29d43f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1542,6 +1542,11 @@ async fn compile(config:CompileConfig)->AResult<()>{ output_place.push("place.rbxl"); } let output=std::io::BufWriter::new(std::fs::File::create(output_place)?); - rbx_binary::to_writer(output,&dom,&[dom.root_ref()])?; + //write workspace:GetChildren()[1] + let workspace_children=dom.root().children(); + if workspace_children.len()!=1{ + return Err(anyhow::Error::msg("there can only be one model")); + } + rbx_binary::to_writer(output, &dom, &[workspace_children[0]])?; Ok(()) }