# Tileobject templates get gid = 0 in .lua

**URL:** <https://discourse.mapeditor.org/t/tileobject-templates-get-gid-0-in-lua/3198>\
**Category:** Bugs\
**Created:** [May 13, 2018, 11:42am UTC](https://discourse.mapeditor.org/t/tileobject-templates-get-gid-0-in-lua/3198 "2018-05-13T11:42:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sefan](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Sefan](https://discourse.mapeditor.org/u/Sefan)\
**Post date:** [May 13, 2018, 11:42am UTC](https://discourse.mapeditor.org/t/tileobject-templates-get-gid-0-in-lua/3198/1 "2018-05-13T11:42:53Z")

</div>

If you use one tileset for tiles and another tileset for template objects. Then all objects get a gid = 0 in the .lua file.  
The problem looks to be that the template object tileset is not added to the .tmx or .lua file when you add a template that contains the tile.  
One workaround i found for this is to place a tile from the template object tileset and save and then delete it.  
The reason why i uses different tilesets is that they have different sizes. Like one 8x8 for my tiles and one 16x16 for my objects.
