First off, the main problem I have is for some reason InvokeRepeating does not work.
InvokeRepeating("check_messages",2,10);
Which basically says run check_messages in 2 seconds every ten seconds.
Now where do I place this line of code for it to correctly work? because right now I have it under start and have tried it out of a function as well and no go.
The code in check_messages does work, I have tested it other ways.
My second problem is that I have a variable that gathers the www.data from a php script. Then it is Split to separate lines in an array[0]. When I set the updated prefs to the array I get the exception.
function setPrefs(){
var form2 = new WWWForm();
form2.AddField("username", PlayerPrefs.GetString("Player Name"));
var w = new WWW(phpscript2, form2);
yield w;
returnlines = w.data;
userInfo = returnlines.Split("\t"[0]);
PlayerPrefs.SetInt("Attack", parseInt(userInfo[2]));
PlayerPrefs.SetInt("Defense", parseInt(userInfo[3]));
PlayerPrefs.SetInt("Vitality", parseInt(userInfo[4]));
PlayerPrefs.SetInt("Health", parseInt(userInfo[5]));
PlayerPrefs.SetInt("Exp", parseInt(userInfo[6]));
PlayerPrefs.SetInt("lvl", parseInt(userInfo[7]));
}
I would really appreciate if someone could point me in the right direction!