This is probably really simple but I can't figure out what I'm doing wrong.
I'm trying to call a random string from an array stored in a .js. Then store it as a game variable through an in-game event.
My .js looks like this
Then through the event I'm doing this....

The message always comes back as 0. I'm getting a "fistname is not defined" error.
Any help would be super appreciated.
Beth
I'm trying to call a random string from an array stored in a .js. Then store it as a game variable through an in-game event.
My .js looks like this
var prenom = ["Bob", "Tim", "Mike", "Joe"];
var firstnames = function() {
var firstname = prenom[Math.floor(Math.random() * 4)];
return firstname;
};
var firstnames = function() {
var firstname = prenom[Math.floor(Math.random() * 4)];
return firstname;
};
Then through the event I'm doing this....

The message always comes back as 0. I'm getting a "fistname is not defined" error.
Any help would be super appreciated.
Beth