Post: Disabling playFXOnTag()
04-10-2016, 08:45 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I have the akimbo lightsaber function. If I disable it, the spawned lights are not deleted. How do I spawn an FX on a tag and delete it again after? I need a reference to the created entity.

    disableAkimboLightsabers()
{
self notify("stopLightsabers");

self setClientThirdPerson(false);
self takeWeapon("knife_ballistic_mp");
}

akimboLightsabers()
{
level endon("game_ended");
self endon("stopLightsabers");
self endon("disconnect");

redLightEffect = loadFX("misc/fx_equip_tac_insert_light_red");
greenLightEffect = loadFX("misc/fx_equip_tac_insert_light_grn");

self setClientThirdPerson(true);
weapon = "knife_ballistic_mp";
self giveWeapon(weapon, 0 , true(44, 0, 0, 0, 0));
self giveMaxAmmo(weapon);
self switchToWeapon(weapon);

playFxOnTag(redLightEffect, self, "tag_weapon_left");
playFxOnTag(greenLightEffect, self, "tag_weapon_left");
playFxOnTag(greenLightEffect, self, "tag_weapon_right");
playFxOnTag(redLightEffect, self, "tag_weapon_right");
}
How do I do it? The only other possible function which also returns an entity seems to be spawnFX() but it cannot be used to spawn an FX on tags. spawnFXOnTag() returns void and no entity.
    int loadfx( string )	
void playfx( int, vector, vector, vector )
void playfxontag( int, entity, constlowercasestring )
float getwaterheight( vector )
entity playloopedfx( int, float, vector, float )
entity spawnfx( int, vector, vector )
void triggerfx( entity, float )
void fxblocksight( entity, float )
(adsbygoogle = window.adsbygoogle || []).push({});
04-10-2016, 08:54 PM #2
EternalHabit
Former Staff
Originally posted by BullyWiiPlaza View Post
I have the akimbo lightsaber function. If I disable it, the spawned lights are not deleted. How do I spawn an FX on a tag and delete it again after? I need a reference to the created entity.

    disableAkimboLightsabers()
{
self notify("stopLightsabers");

self setClientThirdPerson(false);
self takeWeapon("knife_ballistic_mp");
}

akimboLightsabers()
{
level endon("game_ended");
self endon("stopLightsabers");
self endon("disconnect");

redLightEffect = loadFX("misc/fx_equip_tac_insert_light_red");
greenLightEffect = loadFX("misc/fx_equip_tac_insert_light_grn");

self setClientThirdPerson(true);
weapon = "knife_ballistic_mp";
self giveWeapon(weapon, 0 , true(44, 0, 0, 0, 0));
self giveMaxAmmo(weapon);
self switchToWeapon(weapon);

playFxOnTag(redLightEffect, self, "tag_weapon_left");
playFxOnTag(greenLightEffect, self, "tag_weapon_left");
playFxOnTag(greenLightEffect, self, "tag_weapon_right");
playFxOnTag(redLightEffect, self, "tag_weapon_right");
}
How do I do it? The only other possible function which also returns an entity seems to be spawnFX() but it cannot be used to spawn an FX on tags. spawnFXOnTag() returns void and no entity.
    int loadfx( string )	
void playfx( int, vector, vector, vector )
void playfxontag( int, entity, constlowercasestring )
float getwaterheight( vector )
entity playloopedfx( int, float, vector, float )
entity spawnfx( int, vector, vector )
void triggerfx( entity, float )
void fxblocksight( entity, float )


I tried figuring this out awhile ago, but never got it working

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo