Sign In Register

How can we help you today?

Start a new topic

Setting multiple ScriptData

I am trying to create multiple ScriptData, but I only can get 1.

Here is the section that is causin the issue:


var nbOfCharacters = Spark.runtimeCollection(collectionNames.charactersCollection).find({'player_id' : Spark.getPlayer().getPlayerId()},{ "_id" : 0, "player_id" : 0 });

for each(var item in nbOfCharacters.toArray() ) {
    Spark.setScriptData("charactersCollection", item);

 The result is that I only get in the response the 1st character from the list (I never get the 4 other characters).

The goal is to be able to add more scriptdata (with skills, stats, etc.) for each character. But right now I can't generate the 5 scriptData for my 5 characters.

How could I do that? 

Login to post a comment