Scripts / Disable and Enable Flashlight in a trigger zone.

Author
Message
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 29th May 2022 17:46
I'm searching for the possibility to Disable and Enable Flashlight in a trigger zone.

I've found this and modified it. But I'm not having any luck.
--------------------
function disable_flashlight_init(e)
end

function disable_flashlight_main(e)

SetFlashLightKeyEnabled(0)

end
-------------------------

MODIFIED:
-----------------------
function disable_flashlight_init(e)
end

function disable_flashlight_main(e)
if g_Entity[e]['plrinzone']==1 then
PlaySound(e,0)
SetFlashLightKeyEnabled(0)
Destroy(e)
ActivateIfUsed(e)
end
end
------------------------------

Thanks!
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th May 2022 21:52 Edited at: 29th May 2022 21:52
That will only work once as you have Destroy(e) in it.

I think what you want to do is disable the flashlight whilst in the zone and re-enable it when leaving the zone, is that right?
Been there, done that, got all the T-Shirts!
PM
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 30th May 2022 22:03
Yes, AmenMoses! Thanks!

Login to post a reply

Server time is: 2024-04-18 23:29:47
Your offset time is: 2024-04-18 23:29:47