What is rong with this script.

What is rong with this STAT python? :
:mad::o:no: It wount go right . Fu line.

 g = GameLogic c = g.getCurrentController() o = c.getOwner()  Leve12 = 5 Leve13 = 10 Leve14 = 20 Leve15 = 30 Leve16 = 40  if o.Value == "Exp":     o.Text = g.Exp if o.Value == "LVL":     if g.Exp == Leve12 and g.Level == 1:         g.Level = 2         o.setVisible(1)         g.Point = g.Point + 1     elif g.Exp == Leve13 and g.Level == 2:         g.Level = 3         o.setVisible(1)         g.Point = g.Point + 1     elif g.Level == Leve14 and g.Level == 3:         g.Level = 4         o.setVisible(1)         g.Point = g.Point + 1     elif g.Level == Leve15 and g.Level == 4:         g.Level = 5         o.SetVisible(1)         g.Point = g.Point + 1     elif g.Level == Leve16 and g.Level == 5:         g.Level = 6         g.Point = g.Point + 1         o.SetVisible(1)             else:         o.setVisible(0) if o.Value == "Needed":     if g.Level == 1:         o.Text = Leve12     if g.Level == 2:         o.Text = Leve13     if g.Level == 3:         o.Text = Leve14     if g.Level == 4:         o.Texr = Leve16     if o.Value == "Level":     o.Text = g.Level if o.Value == "Next":     o.Text = g.Level + 1 if o.Value == "Dex":     o.Text = g.Dex if o.Value == "Str":     o.Text = g.Str if o.Value == "Point":     o.Text = g.Point if o.Value == "DexInc":     if g.Point > 0:         o.setVisible(1)     else:         o.setVisible(0) if o.Value == "StrInc":     if g.Point > 0:         o.setVisible(1)     else:         o.setVisible(0)          

This is why it helps to seperate your arguments onto seperate lines, much easier to debug :wink:
I could only find one error in it, spelling mistake, here’s the corrected code, give it a shot.

 g = GameLogic c = g.getCurrentController() o = c.getOwner()  Leve12 = 5 Leve13 = 10 Leve14 = 20 Leve15 = 30 Leve16 = 40  if o.Value == "Exp":     o.Text = g.Exp if o.Value == "LVL":     if g.Exp == Leve12 and g.Level == 1:         g.Level = 2         o.setVisible(1)         g.Point = g.Point + 1     elif g.Exp == Leve13 and g.Level == 2:         g.Level = 3         o.setVisible(1)         g.Point = g.Point + 1     elif g.Level == Leve14 and g.Level == 3:         g.Level = 4         o.setVisible(1)         g.Point = g.Point + 1     elif g.Level == Leve15 and g.Level == 4:         g.Level = 5         o.SetVisible(1)         g.Point = g.Point + 1     elif g.Level == Leve16 and g.Level == 5:         g.Level = 6         g.Point = g.Point + 1         o.SetVisible(1)             else:         o.setVisible(0) if o.Value == "Needed":     if g.Level == 1:         o.Text = Leve12     if g.Level == 2:         o.Text = Leve13     if g.Level == 3:         o.Text = Leve14     if g.Level == 4:         o.Text = Leve16     if o.Value == "Level":     o.Text = g.Level if o.Value == "Next":     o.Text = g.Level + 1 if o.Value == "Dex":     o.Text = g.Dex if o.Value == "Str":     o.Text = g.Str if o.Value == "Point":     o.Text = g.Point if o.Value == "DexInc":     if g.Point > 0:         o.setVisible(1)     else:         o.setVisible(0) if o.Value == "StrInc":     if g.Point > 0:         o.setVisible(1)     else:         o.setVisible(0)

Umm… Thanks but where exactly it is ? :stuck_out_tongue:

o.Texr = Leve16

That’s not to say there arn’t other errors, but that’s the only one I can see. My last post contains the corrected code.

Ok, but it still wount work. The script says that it gives lvl and lvl points, but i only can get to lvl 3.:stuck_out_tongue: Whats rong with oder lvl’s ???

Edit: But if i need 10xp and i go over 10 like 11 then i dount get lvl why?

OOPS, here is my mistake…:
Replace elif with if.

``` Leve12 = 5 Leve13 = 10 Leve14 = 20 Leve15 = 30 if o.Value == "Exp": o.Text = g.Exp if o.Value == "LVL": if g.Exp == Leve12 and g.Level == 1: g.Level = 2 o.setVisible(1) g.Point = g.Point + 1 elif g.Exp == Leve13 and g.Level == 2: g.Level = 3 o.setVisible(1) g.Point = g.Point + 1 if g.Exp == Leve14 and g.Level == 3: g.Level = 4 o.setVisible(1) g.Point = g.Point + 1 elif g.Exp == Leve15 and g.Level == 4: g.Level = 5 o.setVisible(1) g.Point = g.Point + 1 ```

if you have it in separate lines you will get an error message that tells you on which line the problem is. The problem is on the line above that:P if you haven’t messed up a ( ) or " " then it could be higher up.