Would be appreciated
Scripts
What are rawset, rawget?
What are rawset, rawget?
1

-- rawget demonstration
local t = setmetatable({value = 123}, {__index = string})
print(t.value) -- 123
print(rawget(t, "value")) -- 123
print(t.sub) -- function: string.sub
print(rawget(t, "sub")) -- nil
-- rawset demonstration
t = setmetatable(t, {__newindex = function(self, key, value)
	print("Setting \""..key.."\" to \""..tostring(value).."\"")
	rawset(self, key, value) -- Note that we use "rawset" here to actually set the value and to prevent recursion.
end})
t.hello = "World" -- Setting "hello" to "World"
rawset(t, "sub", 456) -- nothing printed
print(t.hello) -- World
print(t.sub) -- 456
1
