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

for loop help

HOT
broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
4,303 views
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
isTouching() only works with triggers. Haven't read the rest of this but I assume you are using isTouching on something that doesn't support it. Just use distance checks.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
isTouching() only works with triggers. Haven't read the rest of this but I assume you are using isTouching on something that doesn't support it. Just use distance checks.
I am using it on a trigger radius.
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Ok the 1 potential bug I saw I thought to try and fix if that could be the case. But test this 1. This will probably be my last idea I have to fix this.
Code Snippet
Plaintext
Main()
{
Place1 = GetEnt( "place1", "targetname" );
place1 thread function( "m9" );
}

function( Weap )
{
ice_model = GetEnt( "ice_model", "targetname" );
level.KillCount = 0;//Maybe throw in while loop if it keeps running over and over otherwise here will be fine
while( IsDefined( self ) )
{
ice_model hide();
self waittill( "trigger", Player );
CurrWeap = Player GetCurrentWeapon();
if( CurrWeap == Weap )
{
self trigger_off();
Player takeweapon( CurrWeap );
ice_model show();
Zombs = GetAISpeciesArray( "axis", "all" );
for(;;)
{
for( i = 0; i < Zombs.size; i++ )
{
if( Zombs[i] IsTouching( ice_radius ) )
Zombs[i] thread KillWatch();
if( level.KillCount >= 3 )
break;
}
if( level. KillCount >= 3 )
break;
wait .05;
}
self trigger_on();
ice_model SetModel( "zombie_3rd_perk_bottle_doubletap" );
self waittill( "trigger", Player );
Player GiveWeapon( CurrWeap + "_upgraded" );
Player SwitchToWeapon( CurrWeap + "_upgraded" );
ice_model hide();
}
//If you only want to run this once add the if( level.KillCount == 3 ) break;
wait .05;
}
}

KillWatch()
{
self notify( "DontRegister" );
        self endon( "DontRegister" );
        self waittill( "death" );
level.KillCount += 1;
}
Edit: Incase you saw the previous script I thought of a bug that would happen so just try this. Hopefully I can edit but last thing for sure. Last Final Update should fix everything.
Last Edit: May 19, 2014, 05:49:39 pm by PROxFTW

 
Loading ...