Correct way to spawn a tc?Solved
Seems when i spawn it on top of the foundation it does not detect its there as in i have not bulding priv window. do i need to set it parent to the foundation its spawned on?

               string blockid = npcData.Box[sign.net.ID.ToString()].BoxID;
               var block = BaseNetworkable.serverEntities.Find(Convert.ToUInt32(blockid)) as BuildingBlock;
               BuildingPrivlidge tc = (BuildingPrivlidge)GameManager.server.CreateEntity("assets/prefabs/deployable/tool cupboard/cupboard.tool.deployed.prefab");
               if (block == null) return;
               tc.transform.position = block.transform.position;
               tc.gameObject.SetActive(true);
               tc.Spawn();
               SpawnRefresh(tc);
               tc.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
               tc.SendNetworkUpdateImmediate();

               Puts("Spawned the tc");​
I got it 

var tcid = BuildingManager.server.NewBuildingID();
decayEntity.AttachToBuilding(tcid);
tc.AttachToBuilding(tcid);

Merged post

One problem im having is how do i make it on the foundation so it does not destroy when i build. It looks like its on the foundation
Ts3hosting
I got it 

var tcid = BuildingManager.server.NewBuildingID();
decayEntity.AttachToBuilding(tcid);
tc.AttachToBuilding(tcid);

Merged post

One problem im having is how do i make it on the foundation so it does not destroy when i build. It looks like its on the foundation

It happens because you spawned it wrong. If you want spawn a TC, check how deployables work

P.S. Use copy-paste and save your time

Locked automatically