diff --git a/src/runner/instance.rs b/src/runner/instance.rs index b0719be..551c6ff 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -88,8 +88,9 @@ impl mlua::UserData for Instance{ dom(lua,|dom|{ let instance=this.get_mut(dom)?; let index_str=index.to_str()?; - let class=rbx_reflection_database::get().classes.get(instance.class.as_str()).ok_or(mlua::Error::runtime("Class missing"))?; - let property=class.default_properties.get(index_str).ok_or(mlua::Error::runtime(format!("Property '{index_str}' missing on class '{}'",class.name)))?; + let db=rbx_reflection_database::get(); + let class=db.classes.get(instance.class.as_str()).ok_or(mlua::Error::runtime("Class missing"))?; + let property=db.find_default_property(class,index_str).ok_or(mlua::Error::runtime(format!("Property '{index_str}' missing on class '{}'",class.name)))?; match property{ rbx_types::Variant::Vector3(_)=>{ let typed_value:Vector3=value.as_userdata().ok_or(mlua::Error::runtime("Expected Userdata"))?.take()?;