1. I am trying to take XP points from a player without having to reset and add his Xp.

    The point is avoiding: player.xp.Reset(). And take Xp just like when you learn an item.

    Is that possible?
     
  2. Wulf

    Wulf Community Admin

    player.xp.SetValue(long id, float total) should work.
     
  3. player.xp.SetValue(player.userID, 20)

    Code:
    cannot convert `ulong' expression to type `long'
    I am a little confused. ID should be players id?
     
  4. Wulf

    Wulf Community Admin

    It should be, you could try casting to long before sending it.
     
  5. I've converted the players ID to Int64, and there is no NRE, but it does not do anything. Maybe Rust developers did'nt finish that function.
     
  6. Wulf

    Wulf Community Admin

    Pretty sure it is already used, just not sure what the long is.
     
  7. The SetValue method is actually no longer used anywhere and looks somewhat incomplete, you can however create your own method doing what SetValue is supposed to do by using reflection.

    If you want to actually just take away experience without using Reset and Add as you said you could use `SpendXp(int xpCount, string Category)` to do so. Not sure if category can be anything or has to be something specific but checking that shouldn't be too hard :)
     
  8. Solved. Thank you.