It seems that CFrames are lost when encoding a table to json. Is there any way to easily convert a CFrame to a string and vice versa?
I'd use something like these two functions:
01 | function encode_cframe(cf) |
02 | return string.format(string.rep( "%f " , 12 ), cf:components()) |
03 | end |
04 |
05 | function decode_cframe(cf) |
06 | local tab = { } |
07 | for s in gmatch(cf, "%d+" ) do |
08 | table.insert(tab, tonumber (cf)) |
09 | end |
10 | return CFrame.new( unpack (tab)) |
11 | end |
Untested, but should work.
EDIT: small fix.