Okay I'm trying to set these objects in the user class, but for some reason it's not saving. It's very straight forward, or it seems like it should be:
This gets user:
var actionCompleted = results[i].get("ActionComplete");
var user = results[i].get("User");
This Gets Objects:
var moneyLost = user.get("MoneyLost");
var daysRow = user.get("DaysInRow");
var daysWoken = user.get("DaysWoken");
var daysLate = user.get("DaysLate");
This Sets and Saves The Objects:
user.set = ("MoneyLost", moneyLost + bountyVal);
user.set = ("DaysInRow", daysRow++);
user.set = ("DaysWoken", daysWoken++);
user.save(user, {
success: function(gameScore) {
// Execute any logic that should take place after the object is saved.
alert('New object created with objectId: ' + gameScore.id);
},
error: function(gameScore, error) {
// Execute any logic that should take place if the save fails.
// error is a Parse.Error with an error code and message.
alert('Failed to create new object, with error code: ' + error.message);
}
});
And This Sets and Saves More Objects:
user.set = ("DaysInRow",0);
user.set = ("DaysLate", daysLate++);
user.save(user, {
success: function(gameScore) {
// Execute any logic that should take place after the object is saved.
alert('New object created with objectId: ' + gameScore.id);
},
error: function(gameScore, error) {
// Execute any logic that should take place if the save fails.
// error is a Parse.Error with an error code and message.
alert('Failed to create new object, with error code: ' + error.message);
}
});