I need a way of getting an FX by targetname or something to trigger a terminal deletion of said FX. Here's what I tried:
Code Snippet
Plaintext
trigger = GetEnt("trigger_1", "targetname"); fx = GetEnt("fx_1", "targetname");
trigger waittill("trigger", player);
fx Delete(); trigger Delete();
In order to delete an fx you must use playfxontag. To use playfxontag you have to use a model. So what you can do is spawn the script_model where you want the fx, set it to a tag_origin model, and then playfxontag on that tag_origin of the model.
Code Snippet
Plaintext
ent = Spawn( "script_model", origintospawn );//replace origintoispawn with the position to spawn model ent SetModel("tag_origin"); fx = pathandnameoffxyouprecached;//or however your adding fx PlayFXOnTag(fx,ent,"tag_origin");
Then when your ready to delete the fx, delete the model:
Its not as easy, but you would still prob playfxontag but using csc syntax in a csc script and then using stopfx.
you can find many examples in the scripts. You want to prob use gsc, and spawn the model and delete the model. It works just fine, unless your fx has some odd delay and you want it to stop quicker.