I want to make a fake instance that has custom functions however I ran into a problem where if you try
the error it provides is
return x[ke:19: invalid argument #3 (Instance expected, got table)
– Code i have tried –
this code makes a fake table for an instance and you can set stuff to it, just not parent anything to it
local Baseplatespoof = {}
local x = game.Workspace.Baseplate
function Baseplatespoof:Example(...)
print(...)
end
setmetatable(Baseplatespoof, {
__newindex = function(_, key, value)
x[key] = value
end,
__index = function(table, key)
return x[key]
end
})
Baseplatespoof:Example("I am cool!")
print(Baseplatespoof.Name)
-- error with this code here
Instance.new("Part").Parent = Baseplatespoof