that last answer i believe was in C#
which is giving you additional errors when its in your javascript.
the whole problem is that a vector3 variable contains a set of three seperate NUMBERS.
restoreplayerpos is a string variable. so the the computer sees it as just one variable of text characters that dont nessisarily have a mathmatical value. So your problem is more complex than you think! I can try to get you in the right direction. it is possible to convert your string to the three numeric values to form a Vector3.
if your restoreplayerpos is formated exactly like this -17.6, 1.4, 21.2
this code will split your string at the commas and push the three variables into an array called words.
var words = new Array();
words = restoreplayerpos.Split(","[0]);
now you have 3 seperate strings for your vector3 and eliminated the commas characters so we can convert them out of string format.
var posx:float;
var posy:float;
var posz:float;
float.TryParse(words[0],posx);
float.TryParse(words[1],posy);
float.TryParse(words[2],posz);
now we got 3 actual numbers with a value out of the string so lets put them together to make a real Vector3.
var realvector:Vector3;
realvector=Vector3(posx,posy,posz);
playerObject.transform.position = realvector;
just paste these lines in your code to declair your position. it will work. read up on strings!
var posx:float;
var posy:float;
var posz:float;
var words = new Array();
var realvector:Vector3;
words = stringyouarecoverting.Split(","[0]);
float.TryParse(words[0],posx);
float.TryParse(words[1],posy);
float.TryParse(words[2],posz);
realvector=Vector3(posx,posy,posz);
playerObject.transform.position = realvector;
and btw,if your string contains anything else like brackets this wont work you would have to use an extra line like this before you convert to eliminate whatever other characters in the string.
nameofstingtoconvert.Replace("(","");
nameofstingtoconvert.Replace(")","");