roblox_emulator: implement __newindex Int32

This commit is contained in:
Quaternions 2025-04-22 21:23:08 -07:00
parent 8b6166f48e
commit e6fb8437b3
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131

@ -371,6 +371,10 @@ impl mlua::UserData for Instance{
let typed_value=value.as_boolean().ok_or_else(||mlua::Error::runtime("Expected boolean"))?;
rbx_types::Variant::Bool(typed_value)
},
rbx_reflection::DataType::Value(rbx_types::VariantType::Int32)=>{
let typed_value=value.as_i32().ok_or_else(||mlua::Error::runtime("Expected Int32"))?;
rbx_types::Variant::Int32(typed_value)
},
rbx_reflection::DataType::Value(rbx_types::VariantType::String)=>{
let typed_value=value.as_str().ok_or_else(||mlua::Error::runtime("Expected string"))?;
rbx_types::Variant::String(typed_value.to_owned())