I made a poison gas bomb + switch, which instantly kills all entities that are near the range of the gas bomb.
bomb
switch
About switch.lua script
The script is pretty well explained, however if you have any doubts, questions, or suggestions, you are free to do it.
You must locate your entity's numbers, in my case I used masked soldier. (better explained into the "switch.lua" script)
It is inspired in Smallg scripts, of course. Thanks a lot mate
About "gasmask.lua" script
Please set this script to you GasMask entity in their "Main", via properties panel.
About the model (switch)
The switch model is animated, but I can not get the animation working , I do not know why, if you get it working, please share it.
I think maybe because the door is animated too, IIRC Reloaded does not allow 2 animation running at time, in the same map.
ZIP file contain:
Floders called, "on_off_switch" and "chemical bomb", place them into your "entitybank" folder.
Scripts called "switch.lua", and gasmask.lua, place them into your "scriptbank" folder.
Set soldier as neutral if you want, using "ai_neutral.lua" script, in their "main", via "properties panel".
About gas bomb
Since we can not coltrol "StartParticleEmitter(e)" function, things such, size, amount, density, even direction of the particle, in my case poison gas, so i decide place 5 bombs on the map, 4 of them are invisible, but emitting gas. You should set "Spawn At Start=No" in properties panel. So you get a decent amount of gas into the room.
Gas stop emitting when player go away from switch, and you'll have to activate it again, but maybe you don't need do so, or yes.
video without gas mask - player will dead.
video with gas mask - player is safe.
Quote: "I have declared a global variable named "plrHasMask", and I've placed in my global.lua file, please do likewise, so that the script works"
Edit: This quote above was changed, because the AuShadow suggestion, he is right and I miss "global.lua" file will be update.
Now I has placed "plrHasMask=0" into the "switch.lua" script.
Notice I also had added the "gasmask" script, who control if player already has the "GasMask" collected.
Apologies to all for my fault.
A lot of thanks to AuShadow's suggestion.
Thanks for see my videos and yours feedbacks, enjoy.
08/30/2015 - Important note:
I've made some change in scripts, so if you had downloaded it, please re-download it.
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics