JSON Models
JSON Models describe a simple set of Instances.
Unlike Model Files (RBXM/RBXMX;) their data is limited to that which can be assigned by a script (e.g., no MeshPart data.)
Syntax
File Name
*.Model.JSON
Keys
name: string (Optional)className: string (Optional)properties: {[string]: any} (Optional)- Functions as
instance[property] = value.
- Functions as
attributes: {[string]: any} (Optional)- Functions as
instance:SetAttribute(attribute, value).
- Functions as
tags: {string} (Optional)- Functions as
CollectionService:AddTag(instance, tag)
- Functions as
children: {Instance} (Optional)
Example
A JSON Model describing a Model containing a small green Part and a RemoteEvent would be written as a file named {example}.Model.JSON with:
json
{
"name": "Money",
"className": "Model",
"children": [
{
"className": "Part",
"properties": {
"BrickColor": [ "BrickColor.new(\"Bright green\")" ],
"Size": [ "Vector3.new(1, 0.4, 2)" ]
}
},
{
"name": "CollectMoney",
"className": "RemoteEvent"
}
]
}