Im Still trying to learn this folowing other plugins examples this is what i got..
public BaseEntity bloon;
private StorageContainer bloonfule;
BaseEntity bloon = GameManager.server.CreateEntity("assets/prefabs/deployable/hot air balloon/hotairballoon.prefab", playerPos, playerRot);
bloonfule = bloon.GetComponent<StorageContainer>();
if (bloonfule != null) {
bloonfule.inventorySlots = 1;
bloonfule.SendNetworkUpdate();
bloon.Spawn();
}
so i see now that bloonfule is returning null...witch is tossing the error unshue why.
is there an easer way to make that entity not require fuel?
Merged postGuess im not sure how containers work would it not spawn the container with the entity?
Merged postso this works to spawn item in a box but not in the hotairbloon..
var bloon = GameManager.server.CreateEntity("assets/prefabs/deployable/woodenbox/woodbox_deployed.prefab", playerPos, playerRot);
bloon.Spawn();
var bloonfule = bloon.GetComponent<StorageContainer>();
Item item = ItemManager.CreateByItemID(-946369541, 1);
int slots = 1;
ItemContainer container = new ItemContainer ();
container.ServerInitialize (null, slots);
container.GiveUID ();
bloonfule.inventory = container;
item.MoveToContainer(bloonfule.inventory);