Is there something wrong with my code?

Hello, so im have a bit of trouyble with my script. my script is supposed to edit a json encoded table.this jsonencoded table is in a value in workspace as shown below:

	local HttpService = game:GetService('HttpService')
	local decoded = HttpService:JSONDecode(game.Workspace.PLPLPLP.Value)

	decoded["Thing"] = 5
	print(decoded.Thing) --> 5

end 

script.Parent.MouseButton1Down:connect(OnClicked)

btw heres the script encoding the table:

local HttpService = game:GetService("HttpService")

local inventoryString = game.Workspace.PLPLPLP

local Inventory = {

["Thing"] = 1;

}

inventoryString.Value = HttpService:JSONEncode(Inventory)

please feel free to comment if you have any questions

Why do you do
print(decoded.Lime) and not print(decoded.Thing) ?

oops it was a mistake, i was trying to change the name and forgot to change “lime”

Do you get any errors? Does it not do anything?

yeah for some reason it wont do anything

should i use a module script? or does it not matter