Hi, I wanna make a script that makes a dictionary table, and inserts a player’s userid along with two values (IsRedacted and Icon) to the dictionary. Not sure how to do this, I’d also need to read from the table to check if the player’s userid is in the dictionary and what values are attached to the userid, and remove them from the table at one point.
By using the player’s UserId as the key for this dictionary and a nested dictionary containing the keys isRedacted and Icon as the value, you can do all of the things that you wanted to achieve:
local info = {
[UserId] = {
isRedacted = true,
Icon = "" -- your icon
}
}
Reading / check if id is in dictionary:
if info[player.UserId] then
print(info[player.UserId].isRedacted, info[player.UserId].Icon)
end
Wonderful, thank you, one more thing, you sent me how I would add it to the table manually, how would I do so from a script? so table.insert something I guess.