Create a new object type

Make your own items type.

To create your object type. You need to register it, you can split ( and this is recommended! ) in files, for each realm ( server, client, shared )

To register it, you will use ashop.RegisterObjectType(OBJECT_TYPE).

But, what is YourTable ? We will see below. I want to make a command system, to run a command when a player executes it. So I will need a client file, and server, and shared.

For each file, you need this header:

```glua
local OBJECT_TYPE = {}

OBJECT_TYPE.Name = "YOUR ITEMTYPE NAME"
OBJECT_TYPE.UniqueIdentifier = "A UNIQUE IDENTIFIER, YOU CAN SIMPLY PUT YOURNAME_ITEMTYPENAME"
```

Now, you need to add things:

OBJECT_TYPE.ItemParameters: A list of parameters items will use. For example, on accessories, we need to define a model for every item.

For my system, I want customers to put their own command. So my itemParameters will be

```glua
OBJECT_TYPE.ItemParameters = {
    [1] = {
        name = "Your cool command",
        type = TYPE_STRING,
        options = {
            required = true
        }
    },
}
```

Last updated