Jump to content

Issue with changing maps


drakth
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...