![]() |
One npc triggered by another one
I'm making a script and I want to use the command placenpc. I need to to be triggered by the original weapon, but I don't know how to do that because "if (weaponfired)" won't work and "if (hasweapon(weapon))" won't work because that I don't want it to activate instantly. How do I trigger a separate npc with a weapon?
|
:O I just got an idea. I could make a separate flag. I can use this.bomb and this.explosion to trigger the other weapon.
(Try to guess what weapon this is, there was a hit in those flags ;)) |
Quote:
|
Quote:
(Why would you have to report me?) |
lol
Quote:
|
Quote:
|
Quote:
Here it is: Weapon: PHP Code:
remotebomb.txt: PHP Code:
|
If I remember right, putnpc doesn't work in the editor anymore, and haven't for 6+ years.
|
Quote:
(Also, I'm just curious, if it did still work, would this script be successful?) |
I'm pretty sure putnpc does still work within the editor, it might just be a case of the text file not being found. It may need to be placed within the same folder as the level, or manually browsed to within the NPC image field for it to be added to filenamecache.txt.
|
Quote:
|
The placed NPC would be a separate object to the original weapon script, so the this. variable would not transfer between them. It should use 'if(created){}' as the condition, and then probably use 'destroy;' rather than 'hide;'.
Also I know this is old gscript but I believe you still need to use '==' rather than a single '='. A single '=' is for assigning values, whereas a double '==' is for comparing different values. In modern gscript using just one would result in the condition being determined as true, even if the 2 compared values were different. |
Quote:
|
Quote:
It should be for example: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Quote:
|
Quote:
|
Quote:
Quote:
It should be fine to do: PHP Code:
|
Quote:
Weapon: PHP Code:
PHP Code:
|
The problem now is that you are checking if conditions are true having already determined if a previous condition was true, and so both actions are happening within the same fire.
While there are better ways to go about this, this script could be compressed down to: PHP Code:
Quote:
You could try: PHP Code:
PHP Code:
|
Quote:
|
| All times are GMT +2. The time now is 04:52 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.