#why wtf is stuff in the array showing up as nil instead of just being removed from the table
42 messages · Page 1 of 1 (latest)
bro i dont wanna do table.remove im gonna make it a mixed table later
table.remove doesnt work on dictionaries
i just wanna set the key to nil this usually works but not now for some reason wtf
As long as you have the value
Your owners[k] = nil is the same as doing table.remove(owners, k)
but im p sure table.remove doesnt work on mixed tables
if i was to make one of the ids values another table table.remove wont do anything to the table its in
as long as it's a table you can use table.remove 😭
The thing with remove is you have to find the index for the specific item you want to remove
So my example doesn't work
ok let me test rq if table remove even works
ok it works
again tho ima make it a mixed table later if table remove doesnt work on that ima be pissed
It would be something like this:
local Table = {
["Foo"] = {["Boolean"] = false, nil, "string", 12345}
}
table.remove(Table.Foo, table.find(Table.Foo, "Boolean"))
That will remove the "Boolean" index
If you didn't name your index (which you did), you'd want to use table.find()
Hold on let me give u a better example for your scenerio
also why does setting the table to nil not work in this scenario but works in all others
setting the table key to nil is a standard practice idk why i have to use table.remove in this instance
confused
I'm unsure on why nil is staying within your table
Actually you can just use table.remove without using table.find
Since you're using a for loop
table.remove(Table.Foo, value)
whats the deal here
yes
it works here not in the other script
it just shows up in the table as nil instead of being removed
wtf is even going on bro
i give up
@fathom mirage what is this
Ok what?
bro if its a mixed table its just gonna get messed up
i dont think u understand