View unanswered posts | View active topics It is currently Thu Dec 26, 2024 3:50 am



Reply to topic  [ 3 posts ] 
 Suicide Bomber Script (need help please) 
Author Message
User avatar

Joined: Wed Jan 23, 2013 10:05 pm
Posts: 46
Location: USA
Reply with quote
Post 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.


Last edited by SzGamer27 on Fri Feb 08, 2013 8:02 pm, edited 2 times in total.



Wed Feb 06, 2013 10:47 pm
Profile

Joined: Tue Dec 04, 2012 1:31 am
Posts: 45
Reply with quote
Post 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.


Thu Feb 07, 2013 6:31 am
Profile
User avatar

Joined: Wed Jan 23, 2013 10:05 pm
Posts: 46
Location: USA
Reply with quote
Post 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


Thu Feb 07, 2013 8:02 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.043s | 15 Queries | GZIP : Off ]