Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I define custom properties in Roblox-defined tables?

Asked by
nc2r 117
3 years ago
Edited 3 years ago
Instance.brandNew = Instance.new

So I can do

local part = Instance.brandNew("Part", workspace)

Attempt to write to a read only table error. How do I overrite that? Similarly,

Faces.insult = function(insult)
    print("Your FACE is a '..insult)
end

How do I do something like that?

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

I'm pretty sure that you can't. You can however use a ValueBase intance to parent to the Instance instead. (StringValue, BoolValue, NumberValue, IntValueetc.)

Ad

Answer this question