Change value of dictionary

Hello guys, im trying to make a shop system and i need to change the value of a dictonary to tell if the item has been sold. The value inside the dictonary should be N if not sold and Y if sold. If they buy the item i want to change the N to Y but I’m having trouble doing this. How do i change the value of a dictonary?

example:

local Items = {
["1"] = "N"
["2"] = "N"
}

--how to change N to Y?
1 Like

Not too hard, all you have to do is this:

Items[1] = "Y"

Hope it helps!

2 Likes

I’ll give you the solution but if anything goes wrong, ill be back as I’m not able to test the code for a while.

Their dictionary’s indices are strings so it’d need to be.
Items["1"] = "Y"
In this case however they should be using an array.

1 Like