drakth Posted January 15, 2014 Share Posted January 15, 2014 Hi everyone, I was doing the loading map tutorial that was posted here on the forums, and it worked nice until i decided to attach a weapon to the player. The problem appears when the new level is loaded, i start getting error like: "Attempt to index field 'muzzlelight' (a nil value)" This error occurs at the following code in the fpsweapon.lua if self.muzzlelight:Hidden()==false then if t-self.firetime>50 then self.muzzlelight:Hide() end end I suppose it happens because the object is not initialized (not sure tho) i could check for that by doing something like: If self.muzzlelight ~= nil then .... end But i dont think that would be the best. Assuming the problem is the object that is not initialized is there a way to initialize them? I tried calling the Start function but for some reason it didnt work. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.