From a21861918b4b51cd668d561b3a26e775fc9f257a Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Wed, 22 Mar 2023 10:15:39 +0100 Subject: [PATCH] Prevent setting Parent prop of DataModel instances --- packages/lib-roblox/src/instance/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/lib-roblox/src/instance/mod.rs b/packages/lib-roblox/src/instance/mod.rs index 499b306..1a52222 100644 --- a/packages/lib-roblox/src/instance/mod.rs +++ b/packages/lib-roblox/src/instance/mod.rs @@ -732,6 +732,11 @@ impl LuaUserData for Instance { "Failed to set property '{}' - root instance can not be reparented", prop_name ))); + } else if this.get_class_name() == "DataModel" { + return Err(LuaError::RuntimeError(format!( + "Failed to set property '{}' - DataModel can not be reparented", + prop_name + ))); } type Parent = Option; match Parent::from_lua(prop_value, lua)? {