When this code runs whenever rust.BroadcastChat("TEST"); is ran it throws this error.Code:public class itemQueue : RustPlugin{ public BasePlayer player; public SpecialQueue<ItemCraft> queue; public itemQueue(BasePlayer ppl) { this.player = ppl; this.queue = new SpecialQueue<ItemCraft>(); loopQueue(); } public void addItem(ItemCraft item){ this.queue.Enqueue(item); } public void remItem(ItemCraft item){ this.queue.Remove(item); } public void dQu_Item(){ this.queue.Dequeue(); } public void loopQueue(){ timer.Repeat(1f, 0, () => { rust.BroadcastChat("TEST"); }); } }
03:04 [Error] Failed to run a 1.00 timer in 'itemQueue v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
03:04 [Debug] at Oxide.Plugins.itemQueue.<loopQueue>m__0 () [0x00000] in <filename unknown>:0
at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00000] in <filename unknown>:0
Any idea why?
NullReferenceException help.
Discussion in 'Rust Development' started by MachineGUID, Nov 10, 2016.
