UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Play fx on Player & Zombies

broken avatar :(
Created 8 years ago
by fanmagic
0 Members and 1 Guest are viewing this topic.
2,040 views
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
Signature
Tears Of The Fallen | Join the project https://discord.gg/8gDNQRj
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
How can i play a fx on all players/zombies?

I need something like that:
Code Snippet
Plaintext
fxonzombs()
{
ai = GetAiArray( "axis" );
for( i = 0; i < ai.size; i++ )
{
fx = spawn("script_model");
fx setmodel("tag_origin");
playfxontag( level._effect["fire"], fx, "tag_origin" );
}
}
And now i need to link the fx to every zombie alive. I think i need to use linkto, but i don't know how.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
you should be able to do it by changing the playFxOnTag to this and removing the other two lines

Code Snippet
Plaintext
playfxontag( level._effect["fire"], ai[i], "tag_origin" );

also the  spawn function requires an origin as the second parameter so like this
Code Snippet
Plaintext
fx = spawn("script_model", (0,0,0));//will place the script_model at origin 0,0,0
or in your case like this
Code Snippet
Plaintext
fx = spawn("script_model", ai[i].origin);//will place the script model at the current origin of the ai
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Fx linkto( ent_to_link_to, "tag_to_link_to" );

I think anyway, check zeroy or ugx script reference for the conditions between the ( )

Edit after last post ---

Dont play the fx on the ai if it's a "looping" fx or you won't be able to stop it - in this case you need a seperate model linked to them instead like you had in the example

And don't use tag origin or it'll be at the zombies feet
Last Edit: July 08, 2016, 04:01:22 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I used just this to add a fire fx to zombies, but I'm not sure if it works with players.
Code Snippet
Plaintext
// self is the zombie here
while(1) {
    playfxOnTag( level._effect[ "explosive_trap_flames" ], self, "j_neck" );
    wait 8;
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links

Dont play the fx on the ai if it's a "looping" fx or you won't be able to stop it - in this case you need a seperate model linked to them instead like you had in the example

And don't use tag origin or it'll be at the zombies feet

really? i thought the fx were supposed quit after the entity was deleted?

Quote
Fx linkto( "tag_to_link_to" );

and the parameters are actually like this, linkTo("entity_to_link_to", "tag_to_link_to"); along with two others for offsetting the linked entity from the tag position
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
really? i thought the fx were supposed quit after the entity was deleted?

and the parameters are actually like this, linkTo("entity_to_link_to", "tag_to_link_to"); along with two others for offsetting the linked entity from the tag position
no they do

But I meant if he didn't want it "permenantky until death" is all

And yea mis type. Banes of typing on a phone with a small screen I guess lol
Last Edit: July 08, 2016, 04:00:44 pm by Harry Bo21

 
Loading ...