Argument 1 Missing or Nil

Hey, I’ve been having issues with this code, and seems like I can’t figure out what’s wrong with it. Could y’all help me out? The full code is listed in the below: _L is used for a framework, don’t worry about it.

return function(tbl)

return _L.Services.HttpService:JSONDecode(_L.Services.HttpService:JSONEncode(tbl))

end

can you use the format I can’t read that well.

--format

Where are you calling this function? What is the purpose of it?

return function(tbl)
	return _L.Services.HttpService:JSONDecode(_L.Services.HttpService:JSONEncode(tbl))
end
1 Like

Clones a table for memory address, it can’t support mixed tables and userdata

1 Like

Do you need it to support mixed tables and userdata? I could write you a quick deep copy function to do the job. I’m not familiar with json operations but I believe they’re a little expensive as far as copying tables goes. Anyways, the error means that either tbl is nil, or the result of JSONEncode is nil. I couldn’t say which since they’re both part of the same expression, and from what I have to go on I don’t have a way to know why either of them would be nil.

Anyways, if you want the deep copy function, just let me know and I’ll post it here.

1 Like

Thanks for the help, sure you can. I only use JSON for other services, as well as I use this module for cloning player’s data, and other things that are needed of store. Also, it doesn’t need mixed table and data.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.