I'm trying to set respawn time of loots but can't figure it out.
I have an object as
When the container destroyed, its marking as destroyed by game. Which means container.isDestroyed is true after that.Code:LootContainer container = getContainer(x);
And I'm trying to reinitialize it for respawn as
Giving me error like this:Code:container.Spawn();
How can I respawn a destroyed container and do you think can game force an another container at same place if I do this?Code:[Oxide] 05:53 [Debug] at (wrapper managed-to-native) UnityEngine.Component:get_transform () at BaseCombatEntity.ServerInit () [0x00000] in <filename unknown>:0 at StorageContainer.ServerInit () [0x00000] in <filename unknown>:0 at LootContainer.ServerInit () [0x00000] in <filename unknown>:0 at BaseNetworkable.Spawn (Boolean networked) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Loot.OnTick () [0x00000] in <filename unknown>:0 at Oxide.Plugins.Loot.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
Notes:
I have tested to create a new container with old's position but I even couldn't get that values from destroyed container. The object actually wasn't disposed on runtime I guess but I don't know whats going on it.
Respawn a destroyed barrel/create at same place
Discussion in 'Rust Development' started by Mahmut Yaman, May 4, 2016.
