Unexpected token ":" --(JSON)

Hi guys I’m just wondering if anyone can give me a hand.
I’m having a bit of trouble loading a JSON file. It keeps telling me that there is an unexpected token “:” and doesn’t say where.
I haven’t used JSON much so don’t know much about its structure but the script looks fine to me, I have run into the same issue the last time I wanted to convert a table to JSON and back but resolved that issue by encoding the table first as a kind of template and then the game will load/decode fine. Unfornunately now though I am not able to encode from a table first, as all of the elements within the JSON script are from outside of FiveM so it has nothing to encode as a template.

Here is the script, but it seems to happen to any JSON script that I make besides decoding in LUA, whether it be from scratch or through an external converter.

{
  "SpoonerPlacements": {
    "ReferenceCoords": {
      "X": "-1720.74438",
      "Y": "-847.704224",
      "Z": "7.78287792"
    },
    "Placement": [
      {
        "ModelHash": "0xd6fb0f30",
        "Type": "2",
        "Dynamic": "true",
        "FrozenPos": "false",
        "HashName": "Apocalypse Dominator",
        "InitialHandle": "272643",
        "VehicleProperties": {
          "Colours": {
            "Primary": "7",
            "Secondary": "6",
            "Pearl": "7",
            "Rim": "0",
            "Mod1_a": "7",
            "Mod1_b": "-1",
            "Mod1_c": "-1",
            "Mod2_a": "7",
            "Mod2_b": "-1",
            "IsPrimaryColourCustom": "false",
            "IsSecondaryColourCustom": "false",
            "tyreSmoke_R": "255",
            "tyreSmoke_G": "255",
            "tyreSmoke_B": "255",
            "LrInterior": "2",
            "LrDashboard": "156",
            "LrXenonHeadlights": "255"
          },
          "Livery": "-1",
          "NumberPlateText": "65KGW913",
          "NumberPlateIndex": "0",
          "WheelType": "1",
          "WheelsInvisible": "false",
          "EngineSoundName": {
          },
          "WindowTint": "-1",
          "BulletProofTyres": "false",
          "DirtLevel": "0",
          "PaintFade": "0.298039228",
          "RoofState": "0",
          "SirenActive": "false",
          "EngineOn": "false",
          "EngineHealth": "1000",
          "LightsOn": "false",
          "IsRadioLoud": "0",
          "LockStatus": "1",
          "Neons": {
            "Left": "false",
            "Right": "false",
            "Front": "false",
            "Back": "false",
            "R": "255",
            "G": "0",
            "B": "255"
          },
          "DoorsOpen": {
            "BackLeftDoor": "false",
            "BackRightDoor": "false",
            "FrontLeftDoor": "false",
            "FrontRightDoor": "false",
            "Hood": "false",
            "Trunk": "false",
            "Trunk2": "false"
          },
          "DoorsBroken": {
            "BackLeftDoor": "false",
            "BackRightDoor": "false",
            "FrontLeftDoor": "false",
            "FrontRightDoor": "false",
            "Hood": "false",
            "Trunk": "false",
            "Trunk2": "false"
          },
          "TyresBursted": {
            "FrontLeft": "false",
            "FrontRight": "false",
            "_2": "false",
            "_3": "false",
            "BackLeft": "false",
            "BackRight": "false",
            "_6": "false",
            "_7": "false",
            "_8": "false"
          },
          "ModExtras": {
            "-self-closing": "true"
          },
          "Mods": {
            "_0": "-1,0",
            "_1": "-1,0",
            "_2": "-1,0",
            "_3": "-1,0",
            "_4": "-1,0",
            "_5": "-1,0",
            "_6": "-1,0",
            "_7": "-1,0",
            "_8": "-1,0",
            "_9": "-1,0",
            "_10": "-1,0",
            "_11": "-1,0",
            "_12": "-1,0",
            "_13": "-1,0",
            "_14": "-1,0",
            "_15": "-1,0",
            "_16": "-1,0",
            "_17": "false",
            "_18": "false",
            "_19": "false",
            "_20": "false",
            "_21": "false",
            "_22": "false",
            "_23": "-1,0",
            "_24": "-1,0",
            "_25": "-1,0",
            "_26": "-1,0",
            "_27": "-1,0",
            "_28": "-1,0",
            "_29": "-1,0",
            "_30": "-1,0",
            "_31": "-1,0",
            "_32": "-1,0",
            "_33": "-1,0",
            "_34": "-1,0",
            "_35": "-1,0",
            "_36": "-1,0",
            "_37": "-1,0",
            "_38": "-1,0",
            "_39": "-1,0",
            "_40": "-1,0",
            "_41": "-1,0",
            "_42": "-1,0",
            "_43": "-1,0",
            "_44": "-1,0",
            "_45": "-1,0",
            "_46": "-1,0",
            "_47": "-1,0",
            "_48": "-1,0"
          }
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "1000",
        "Health": "1000",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "true",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1721.20825",
          "Y": "-851.681152",
          "Z": "7.89215326",
          "Pitch": "-1.22605062",
          "Roll": "-0.780963123",
          "Yaw": "-125.759048"
        },
        "Attachment": {
          "-isAttached": "false",
          "-self-closing": "true"
        }
      },
      {
        "ModelHash": "0x3c26bd0c",
        "Type": "2",
        "Dynamic": "true",
        "FrozenPos": "false",
        "HashName": "Apocalypse Impaler",
        "InitialHandle": "427523",
        "VehicleProperties": {
          "Colours": {
            "Primary": "112",
            "Secondary": "105",
            "Pearl": "27",
            "Rim": "0",
            "Mod1_a": "7",
            "Mod1_b": "-1",
            "Mod1_c": "-1",
            "Mod2_a": "7",
            "Mod2_b": "-1",
            "IsPrimaryColourCustom": "false",
            "IsSecondaryColourCustom": "false",
            "tyreSmoke_R": "255",
            "tyreSmoke_G": "1",
            "tyreSmoke_B": "1",
            "LrInterior": "4",
            "LrDashboard": "13",
            "LrXenonHeadlights": "8"
          },
          "Livery": "-1",
          "NumberPlateText": "   SB   ",
          "NumberPlateIndex": "2",
          "WheelType": "12",
          "WheelsInvisible": "false",
          "EngineSoundName": {
          },
          "WindowTint": "-1",
          "BulletProofTyres": "true",
          "DirtLevel": "14.9000206",
          "PaintFade": "1",
          "RoofState": "0",
          "SirenActive": "false",
          "EngineOn": "true",
          "EngineHealth": "1000",
          "LightsOn": "true",
          "IsRadioLoud": "0",
          "LockStatus": "1",
          "Neons": {
            "Left": "true",
            "Right": "true",
            "Front": "true",
            "Back": "true",
            "R": "255",
            "G": "1",
            "B": "1"
          },
          "DoorsOpen": {
            "BackLeftDoor": "false",
            "BackRightDoor": "false",
            "FrontLeftDoor": "false",
            "FrontRightDoor": "false",
            "Hood": "false",
            "Trunk": "false",
            "Trunk2": "false"
          },
          "DoorsBroken": {
            "BackLeftDoor": "false",
            "BackRightDoor": "false",
            "FrontLeftDoor": "false",
            "FrontRightDoor": "false",
            "Hood": "false",
            "Trunk": "false",
            "Trunk2": "false"
          },
          "TyresBursted": {
            "FrontLeft": "false",
            "FrontRight": "false",
            "_2": "false",
            "_3": "false",
            "BackLeft": "false",
            "BackRight": "false",
            "_6": "false",
            "_7": "false",
            "_8": "false"
          },
          "RpmMultiplier": "1.20000005",
          "TorqueMultiplier": "1.10000002",
          "HeadlightIntensity": "1.10000002",
          "ModExtras": {
            "-self-closing": "true"
          },
          "Mods": {
            "_0": "1,0",
            "_1": "2,0",
            "_2": "0,0",
            "_3": "-1,0",
            "_4": "0,0",
            "_5": "0,0",
            "_6": "-1,0",
            "_7": "0,0",
            "_8": "2,0",
            "_9": "4,0",
            "_10": "0,0",
            "_11": "3,0",
            "_12": "2,0",
            "_13": "3,0",
            "_14": "-1,0",
            "_15": "-1,0",
            "_16": "-1,0",
            "_17": "false",
            "_18": "true",
            "_19": "false",
            "_20": "true",
            "_21": "false",
            "_22": "true",
            "_23": "11,0",
            "_24": "-1,0",
            "_25": "-1,0",
            "_26": "-1,0",
            "_27": "-1,0",
            "_28": "0,0",
            "_29": "-1,0",
            "_30": "-1,0",
            "_31": "-1,0",
            "_32": "-1,0",
            "_33": "-1,0",
            "_34": "-1,0",
            "_35": "7,0",
            "_36": "0,0",
            "_37": "-1,0",
            "_38": "-1,0",
            "_39": "-1,0",
            "_40": "3,0",
            "_41": "2,0",
            "_42": "2,0",
            "_43": "0,0",
            "_44": "-1,0",
            "_45": "1,0",
            "_46": "-1,0",
            "_47": "-1,0",
            "_48": "0,0"
          }
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "1000",
        "Health": "1000",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "false",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1717.93591",
          "Y": "-845.150574",
          "Z": "8.27598476",
          "Pitch": "-0.0941036046",
          "Roll": "0.913011074",
          "Yaw": "-149.42485"
        },
        "Attachment": {
          "-isAttached": "false",
          "-self-closing": "true"
        }
      },
      {
        "ModelHash": "0x573201b8",
        "Type": "1",
        "Dynamic": "true",
        "FrozenPos": "false",
        "HashName": "Cat",
        "InitialHandle": "20740",
        "PedProperties": {
          "IsStill": "true",
          "CanRagdoll": "true",
          "HasShortHeight": "false",
          "Armour": "0",
          "CurrentWeapon": "0xe274ff96",
          "PedProps": {
            "_0": "-1,-1",
            "_1": "-1,-1",
            "_2": "-1,-1",
            "_3": "-1,-1",
            "_4": "-1,-1",
            "_5": "-1,-1",
            "_6": "-1,-1",
            "_7": "-1,-1",
            "_8": "-1,-1",
            "_9": "-1,-1"
          },
          "PedComps": {
            "_0": "0,1",
            "_1": "0,0",
            "_2": "0,0",
            "_3": "0,0",
            "_4": "0,0",
            "_5": "0,0",
            "_6": "0,0",
            "_7": "0,0",
            "_8": "0,0",
            "_9": "0,0",
            "_10": "0,0",
            "_11": "0,0"
          },
          "RelationshipGroupAltered": "false",
          "RelationshipGroup": "0xfade4843",
          "ScenarioActive": "false",
          "AnimActive": "false"
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "200",
        "Health": "200",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "false",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1713.10828",
          "Y": "-834.303772",
          "Z": "8.25370121",
          "Pitch": "0.0947558731",
          "Roll": "-1.16727023e-07",
          "Yaw": "31.6619759"
        },
        "Attachment": {
          "-isAttached": "false",
          "-self-closing": "true"
        }
      },
      {
        "ModelHash": "0x5aa42c21",
        "Type": "1",
        "Dynamic": "true",
        "FrozenPos": "false",
        "HashName": "Vagos Female",
        "InitialHandle": "432132",
        "PedProperties": {
          "IsStill": "true",
          "CanRagdoll": "true",
          "HasShortHeight": "false",
          "Armour": "0",
          "CurrentWeapon": "0xa2719263",
          "PedProps": {
            "_0": "-1,-1",
            "_1": "-1,-1",
            "_2": "-1,-1",
            "_3": "-1,-1",
            "_4": "-1,-1",
            "_5": "-1,-1",
            "_6": "-1,-1",
            "_7": "-1,-1",
            "_8": "-1,-1",
            "_9": "-1,-1"
          },
          "PedComps": {
            "_0": "1,2",
            "_1": "0,0",
            "_2": "2,0",
            "_3": "0,0",
            "_4": "0,1",
            "_5": "0,0",
            "_6": "0,0",
            "_7": "0,0",
            "_8": "2,1",
            "_9": "0,0",
            "_10": "0,0",
            "_11": "-1,0"
          },
          "RelationshipGroupAltered": "false",
          "RelationshipGroup": "0xfade4843",
          "ScenarioActive": "false",
          "AnimActive": "false"
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "200",
        "Health": "200",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "false",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1709.18469",
          "Y": "-840.675415",
          "Z": "9.0086689",
          "Pitch": "0",
          "Roll": "0",
          "Yaw": "31.6619797"
        },
        "Attachment": {
          "-isAttached": "false",
          "-self-closing": "true"
        }
      },
      {
        "ModelHash": "0x43dcc0bb",
        "Type": "3",
        "Dynamic": "false",
        "FrozenPos": "true",
        "HashName": "xs_prop_arena_station_02a",
        "InitialHandle": "770564",
        "ObjectProperties": {
          "TextureVariation": "0"
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "1000",
        "Health": "1000",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "false",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1710.50378",
          "Y": "-820.294312",
          "Z": "8.55421734",
          "Pitch": "0",
          "Roll": "-0",
          "Yaw": "-147.944382"
        },
        "Attachment": {
          "-isAttached": "false",
          "-self-closing": "true"
        }
      },
      {
        "ModelHash": "0x1c9fc8d9",
        "Type": "3",
        "Dynamic": "false",
        "FrozenPos": "true",
        "HashName": "ba_rig_dj_02_lights_04_b_scr",
        "InitialHandle": "173062",
        "ObjectProperties": {
          "TextureVariation": "0"
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "1000",
        "Health": "1000",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "false",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1722.7561",
          "Y": "-829.028809",
          "Z": "9.35421658",
          "Pitch": "0",
          "Roll": "-0",
          "Yaw": "-147.944382"
        },
        "Attachment": {
          "-isAttached": "true",
          "AttachedTo": "770564",
          "BoneIndex": "0",
          "X": "15.0199986",
          "Y": "0.899999976",
          "Z": "0.799999237",
          "Pitch": "0",
          "Roll": "0",
          "Yaw": "0"
        }
      },
      {
        "ModelHash": "0x7a897074",
        "Type": "3",
        "Dynamic": "true",
        "FrozenPos": "false",
        "HashName": "hei_prop_heist_magnet",
        "InitialHandle": "565510",
        "TaskSequence": {
          "Task": {
            "Type": "25",
            "Duration": "1000",
            "KeepTaskRunningAfterTime": "-2",
            "IsLoopedTask": "true",
            "IsRelative": "true",
            "Heading": "0",
            "Pitch": "0",
            "Magnitude": "1"
          }
        },
        "ObjectProperties": {
          "TextureVariation": "0"
        },
        "OpacityLevel": "255",
        "LodDistance": "16960",
        "IsVisible": "true",
        "MaxHealth": "1000",
        "Health": "1000",
        "HasGravity": "true",
        "IsOnFire": "false",
        "IsInvincible": "false",
        "IsBulletProof": "false",
        "IsCollisionProof": "false",
        "IsExplosionProof": "false",
        "IsFireProof": "true",
        "IsMeleeProof": "false",
        "IsOnlyDamagedByPlayer": "false",
        "PositionRotation": {
          "X": "-1731.70459",
          "Y": "-837.193176",
          "Z": "9.68129063",
          "Pitch": "-0.211074546",
          "Roll": "1.2740401",
          "Yaw": "-153.507965"
        },
        "Attachment": {
          "-isAttached": "false",
          "-self-closing": "true"
        }
      }
    ]
  }
}

You have a single object with several key-pair values, try wrapping the object with [], so that [ is at the very top of the file, and ] is at the very end. That will turn it from a JSON object, into a JSON array containing a single object.

Ah I see, thank you it worked :hugs:

1 Like