Jump to content

Flashlight script doesn't work anymore


FoxMulder
 Share

Recommended Posts

Hello everyone,

I was working on a premade LUA script of FPS and I found flashlight script, really nice wink.png

 

However I can't make it work in my personal project. I used this part of the script which is completely correct:

 

--Flashlight
if window:KeyHit(Key.F) then
self.sound.flashlight:Play()
if self.flashlight:Hidden() then
self.flashlight:Show()
else
self.flashlight:Hide()
end
end

 

The flashlight works, the sound is correctly played, however when I hit again the F key the flashlight doesn't turn off but the light becomes brighter and brighter.

 

Before

post-12445-0-48725300-1420284641_thumb.jpg

 

After

post-12445-0-90342900-1420284687_thumb.jpg

 

 

What am I missing ?

 

Thank you again for your precious support !

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...