YossiBz 2 Posted February 1, 2015 You can intiliaze it in ctor Best wishes, Paul. i do this but its give me error on tick when i enable the light Quote Share this post Link to post Share on other sites
leftas 128 Posted February 1, 2015 What error ? Best wishes, Paul. Quote Share this post Link to post Share on other sites
YossiBz 2 Posted February 4, 2015 What error ? Best wishes, Paul. 2015-02-01 21:04:41 - Error during Tick in script 'Seller.Seller': System.NullReferenceException: Object reference not set to an instance of an object. at Seller.Seller.ToggleNeon() at GTA.Script.ProcessBoundKey(Keys Key) at GTA.Script.ProcessEvents() at GTA.Script.DoTick() at GTA.ScriptThread.OnTick() Quote Share this post Link to post Share on other sites
byteMe420 64 Posted February 5, 2015 i suggest this change this... light.Enabled = Neon; instead of... light.Enabled = true;if (!Neon){ light.Disable();} less cpu instructions and easier to read and understand Quote Share this post Link to post Share on other sites
leftas 128 Posted February 6, 2015 Not sure, why your error happens as bool shouldn't have null. But try this.Neon when you do comparing if(!this.Neon) Best wishes, Paul. Quote Share this post Link to post Share on other sites
YossiBz 2 Posted February 7, 2015 Not sure, why your error happens as bool shouldn't have null. But try this.Neon when you do comparing if(!this.Neon) Best wishes, Paul. still the same error Quote Share this post Link to post Share on other sites