Data Realms Fan Forums http://45.55.195.193/ |
|
Suicide Bomber Script (need help please) http://45.55.195.193/viewtopic.php?f=73&t=45112 |
Page 1 of 1 |
Author: | SzGamer27 [ Wed Feb 06, 2013 10:47 pm ] |
Post subject: | Suicide Bomber Script (need help please) |
I need help coding a suicide bomber lua script. I'm pretty sure all the functions exist, but I don't know how to put them all together for my actor. Basically, I just want to make a copy of the Ronin Soldier who is carrying an object called "Dead Man's Switch" that, when dropped out of the inventory, will make him explode. He should also self destruct if he is killed, which shouldn't be too hard if the first thing ends up working. I tried a code that used the function 'Actor.HasObject' and combined it with the script that tells grenades to explode, but it didn't seem to do anything. If someone could give me a pointer, I would really appreciate it. Also, if this does end up working out, it would also be cool to have a delay timer that waits 3/4sec after dying/dropping the switch before exploding. |
Author: | nubbles [ Thu Feb 07, 2013 6:31 am ] |
Post subject: | Re: Suicide Bomber Script |
It should be easy to make a script to kill the RONIN soldier if he drops the item. Not sure about exploding the "switch" though. Maybe just make it gib as soon as it hits the ground, by setting it's force limit to like 0? anyway, making the actor explode should be simple, just something like this: Code: if not self:HasObject("Dead man's switch") then self:GibThis() end Edit: tab button plus enter button = bad things. |
Author: | SzGamer27 [ Thu Feb 07, 2013 8:02 pm ] |
Post subject: | Re: Suicide Bomber Script |
Okay, I'll try that... and no, the switch is not supposed to explode. Now does anyone know how to add an explosion delay? Or even make a beeping noise just before the explosion? Also, would this work for gibbing when the actor is killed? Code: if not self:HasObject("Dead man's switch") or self.Health <= 0 then self:GibThis() end |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |