FerbZides
(FerbZides)
October 9, 2020, 8:01am
#1
similar to:
What’s the difference between a table.insert then changing it to a value than changing it without table.insert?
Before I would expect it like this:
local tb = {
["Oof"] = "Oo1f",
}
table.insert(tb, "LOL")
tb["LOL"] = "oo"
for I,v in pairs(tb) do
print(i,v)
end
-- Output:
--
-- Oof Oo1f
-- LOL oo
Then, now it would be:
-- Oof Oo1f
-- 1 LOL
-- LOL oo
In script, we now put without using table.insert to change the value once it’s inserted:
tb["LOL"] = "oo"
but in that topic it only inserts value not tables
here is my code that i tried to do so but didn’t work they are 2:
table.insert([Player.Name] = true, PlayerInvisibilityTable)
table.insert(Player.Name == true, PlayerInvisibilityTable)
they both give me an error which gives me trouble on fixing it is there a way inserting a table inside table.insert
without making variables because this code wouldn’t entirely work
local PlayerTable = [Player.Name] = {
false;
}
those methods i did won’t actually work so is there a way in inserting a table in table.insert
without writing it as an variable
sjr04
(uep)
October 9, 2020, 8:03am
#2
PlayerInvisibilityTable[Player.Name] = true
tables are values too btw
3 Likes
FerbZides
(FerbZides)
October 9, 2020, 8:06am
#3
my code is written in the table format like this
if PlayerInvisibility[Player.Name] then
end
how to insert a table in table using table.insert tho
like the … will be the solution for this thread if found
table.insert(..., PlayerInvisibilityTable)
sjr04
(uep)
October 9, 2020, 8:06am
#4
Why do you want to use table.insert
when it only inserts to the array part of the table? Don’t you have a dictionary on your hands?
FerbZides
(FerbZides)
October 9, 2020, 8:09am
#5
this is the format of my table
-- example
local List = {
FerbZides = false
}
sjr04
(uep)
October 9, 2020, 8:09am
#6
Okay, so my reply answers your question. You are working with dictionaries, table.insert
is not a solution here.
FerbZides
(FerbZides)
October 9, 2020, 8:33am
#7
but now i can add but how about removing them from the list?
sjr04
(uep)
October 9, 2020, 8:34am
#8
Just do List[Player.Name] = nil