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

help with one script

broken avatar :(
Created 7 years ago
by kitos
0 Members and 1 Guest are viewing this topic.
1,120 views
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 25 May 2016
Last active: 4 years ago
Posts
98
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
kitos's Groups
kitos's Contact & Social Links
I have this script it works 100% but I dont know why the souls not appears
 i have this error

https://imgur.com/a/0wuoH

how can I put the soul goes to door?

help please

Code Snippet
Plaintext
soul_tracker_init()
{
soul_door = getentarray( "soul_door", "targetname" );

for( i=0 ; i<soul_door.size ; i++ )
{
if( isDefined(soul_door[i].script_flag) && !IsDefined( level.flag[soul_door[i].script_flag] ) )
flag_init( soul_door[i].script_flag );
}

level thread zombie_soul_start();
}
zombie_soul_start()
{
trig = getent( "soul_trig", "targetname" );

while(isdefined(trig))
{
zombies = getaiarray( "axis" );
for( i=0 ; i<zombies.size ; i++ )
{
if( !isdefined( zombies[i].soul_zombie ) )
{
zombies[i].soul_zombie = true;
zombies[i] thread soul_watch( trig );
}
}

wait 0.5;
}
}
soul_watch(trig)
{
self waittill( "death", attacker );

if( !isdefined( trig ) )
return;

if( isdefined(attacker) && !isplayer( attacker ) )
return;

if( self istouching( trig ) )
trig thread add_soul_to_door(self.origin);
}
add_soul_to_door(death_origin)
{
if( !isdefined( self.souls ) )
self.souls = 0;

self.souls++;
fx_pos = getstruct( "soul_fx_pos", "targetname" );
fx_tag = spawn( "script_model", death_origin+(0,0,30) );
fx_tag setmodel( "tag_origin" );
playfxontag( level._effect[ YOUR_SOUL_FX ], fx_tag, "tag_origin" ); // SOUL FX
fxtag moveto( fx_pos.origin, 2, 1, 0 );
wait 2;
fxtag delete();
playsoundatposition( SOUL_ADDING_SOUND, fx_pos.origin ); // SOUND WHEN A SOUL GETS ADDED

if( self.souls == 25 )
{
level thread open_special_door();
self delete();
}
}
open_special_door()
{
soul_door = getentarray( "soul_door", "targetname" );

for( i=0 ; i<soul_door.size ; i++ )
{
soul_door[i] notsolid();
soul_door[i] connectpaths();
soul_door[i] moveto( (soul_door[i].origin+soul_door[i].script_vector), 2, 0.5, 0.5 );

if( isdefined( soul_door[i].script_flag ) )
flag_set( soul_door[i].script_flag );
}
}
Marked as best answer by kitos 7 years ago
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
change fxtag to fx_tag. this issue you is when you changed it from including the "_" it no longer counts as the same variable as fx_tag
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 25 May 2016
Last active: 4 years ago
Posts
98
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
kitos's Groups
kitos's Contact & Social Links
Ir works now
Last Edit: August 07, 2017, 04:51:33 pm by kitos

 
Loading ...