So i'm working in an app with a few leaderboards and challenges, the thing is that i need that data to be modify from play fab, so i'm using title data for that... But recently when trying to get an int from title data it is not working correctly
var getTitleDataRequest ={ "Keys": ["DesafiosDisponibles"] }; var getTitleDataResponse = server.GetTitleData(getTitleDataRequest); if (!getTitleDataResponse.Data.hasOwnProperty("DesafiosDisponibles")) { log.error("key not found. Exiting..."); return JSON.stringify([]); } else { var myObject= JSON.parse(getTitleDataResponse.Data.DesafiosDisponibles); for (var i = 0; i < myObject.Items.length; i++) { if (myObject.Items[i].Nombre == args.Leaderboardname) { var baseScore = myObject.Items[i].PuntosBasicos.Value; var correctScore = myObject.Items[i].PuntosBasicos * (myObject.Items[i].BonusRacha.Value / 100) * Racha; var timeScore = myObject.Items[i].BonusTiempo.Value * (Tiempo * 1000); } } } var totalScore = baseScore + correctScore + timeScore; var AddScore = UpdatePlayerScore(args.Leaderboardname, totalScore);
the code works perfectly, the only thing is that "totalScore" is not an int or at least that is what i think since if i change total score to a flat number it works but if i leave it it doesnt (if i debug totalscore it gives me the value i need)