This commit is contained in:
Aaron Smith 2023-09-13 18:23:46 +01:00
parent 0d542c66a6
commit 7dead44ac5
9 changed files with 207 additions and 173 deletions

View file

@ -113,6 +113,7 @@ local Instance = {} :: any do
local function __newindex(userdata: userdata, property: string, value: unknown)
local data = get_data(userdata)
if property == "Name" then
if type(value) ~= "string" then error("name must be a string", 2) end
data.name = value :: string
elseif property == "Parent" then
assert(value == nil or is_instance(value), "attempt to set non-instance as parent")