Ah I see. For the isPremium, wrap the statement in ()s. The joinedDate is a Roblox datatype and not something JSON encoded tables can store. Convert it to a string.
FormatLocalTime returns a string so I don’t need to convert it to a string.
Anyway I tried but still not work. I’m pretty sure that it’s a bug.
I tried to make a custom function to Encode a JSON however, I don’t know for what strange reason, the problem continues to occur:
local function JSONEncode(tableToEncode)
local json = "{"
for k, v in pairs(tableToEncode) do
if typeof(v) == "string" then
v = "\""..v.."\""
else
v = tostring(v)
end
json = json.."\""..k.."\":"..v..","
end
return json:sub(0, -2).."}"
end
As @Swetch29 mentioned, your data code is working perfectly for me as well. Perhaps the issue is another part of your code. Have you tried printing the player instance before the local data line, or printing the player.MembershipType or DateTime.now():FormatLocalTime("lll", "it-it") statements?
Also, did you print the data directly using the built-in print function after the JSON encoding to check if this is the cause of the issue? If it still occurs then perhaps a studio issue, maybe caused by a setting?