I don't get it

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UT_Killer

Scripter
Jun 14, 2001
20
0
0
36
Israel
Visit site
I put the Following code in the ScoreKill Function:
/* Begin Code */
for (Inv = Killer.Inventory; Inv != None; Inv = Inv.Inventory)
{
if ( Inv.IsA('SpeedWeapon') )
if (SpeedWeapon(Inv).SpeedScale >= 30
{
SpeedWeapon(Inv).SpeedScale = 30;
}
else
{
SpeedWeapon(Inv).SpeedScale += 0.1;
}
}
/* End Code */
And when speedscale is > for 30 it's steel Speed UP the weapon fire. What is the problem?
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Use [code] [/code], it makes code much more readable:
Code:
for (Inv = Killer.Inventory; Inv != None; Inv = Inv.Inventory) 
{
     if ( Inv.IsA('SpeedWeapon') )
          if (SpeedWeapon(Inv).SpeedScale >= 30
          {
               SpeedWeapon(Inv).SpeedScale = 30;
          }          
          else
          {
               SpeedWeapon(Inv).SpeedScale += 0.1;
          }
}

Hmm... try this instead:
Code:
for(...) {
    if ( Inv.IsA('SpeedWeapon') && SpeedWeapon(Inv).SpeedScale < 30 )
        SpeedWeapon(Inv).SpeedScale += 0.1;
}