diff --git a/lib/roblox_emulator/src/runner/instance/instance.rs b/lib/roblox_emulator/src/runner/instance/instance.rs index e57c017..77b8662 100644 --- a/lib/roblox_emulator/src/runner/instance/instance.rs +++ b/lib/roblox_emulator/src/runner/instance/instance.rs @@ -345,6 +345,11 @@ impl mlua::UserData for Instance{ let typed_value=value.as_str().ok_or_else(||mlua::Error::runtime("Expected string"))?.to_owned(); rbx_types::Variant::ContentId(typed_value.into()) }, + rbx_reflection::DataType::Value(rbx_types::VariantType::Ref)=>{ + // why clone? + let typed_value=Option::<Instance>::from_lua(value.clone(),lua)?; + rbx_types::Variant::Ref(typed_value.map_or(Ref::none(),|instance|instance.referent)) + }, other=>return Err(mlua::Error::runtime(format!("Unimplemented property type: {other:?}"))), }; // the index is known to be a real property at this point