#my very very very simple metatable dont work

1 messages · Page 1 of 1 (latest)

limpid rune
#

what am i doing wrong (this is my first time with metatables)

issue is that nothing will print even when values in the table change (on the server) no errors

stuck hornet
#

I forgot the exact way how but you need to actually declare the behavior

#

Or maybe the function isn’t running I’m not too familiar with meta tables actually

near sluiceBOT
#

studio** You are now Level 16! **studio

floral rivet
#

;compile lua ⁨⁨lua local meta={ __newindex=function(a,b,c) print(a," ",b," ",c) end } local t=setmetatable({},meta) t.foo="bar"⁩⁩

oblique flaxBOT
#
Program Output
table: 0x59b33ad01d40 foo bar

floral rivet
limpid rune
#

@floral rivet can i also just type
setmetatable({},meta).foo = “bar”

floral rivet
#

why would you ever do that

limpid rune
#

wait

#

wait nvm i see why that wont work

floral rivet
floral rivet
limpid rune
floral rivet
floral rivet
#

anyway google lua metamethods

#

that should help. roblox docs probably has a page for it

edgy herald
#

local function cursed() return (({} :: {[any]: any})[({} :: {[any]: any})] or function() return cursed() + ({} :: number) end)() end type shit

limpid rune
limpid rune
#

mannnnn i give up on this metatable stuff

#

im just going to do this without a metatable since theres a very easy way to do it without

edgy herald
# limpid rune im just going to do this without a metatable since theres a very easy way to do ...
limpid rune
#

lemme do that... tomorrow

edgy herald
limpid rune
#

school tomorrow🗣️

edgy herald
#

valid

#

same tho