Trying to create a loop which goes through values of a table then using those values finds part of a GUI with the same name to alter it.
Currently I have a manual script which works but has to be done per value:
Once I add more weapons it would be long having to go through every item to find it
So I thought I would create a loop to go through every part of the table and if it finds that name in the gui then it can alter it, currently it looks like this:
Which returns this error:
The print which can be seen at the top of the first image of script looks like this:
This table is sent to the client from a server script which is made like this:
(Copies owned items into a new folder inside replicated storage so the client can read it, before deleting the folder)
Im assuming this error is down to how the table is printed out ([“M4A1”] = M4A1 rather than just M4A1) but ive tried messing around with this part of the script and changing the last line (Inventory1Owned[Item.Name] = clientItem) but have only got errors when doing so