Read, study, go over, and do all these about 5 more times. THEN, post on here. If you don't try at all and just copy and paste code like a script kiddie, then no one is going to help you. I repeat, NO ONE is going to help you, and if they do, than that sucks for them, because it's a waste. If you want people to give you the time of day, then you have to, at the least, try for your self first. So, I say, go through the first link. Then go through the third link. Now, go through the second link on all the major things, and learn a little bit before you just post random things for us to fix for you... The problem with the script you posted is something so minor, that you should be able to point out in a second. But to hell if I'm going to tell you, because if you took but 2 minutes of your own time to actually go through a script, you'd see it, you'd know how to create a script, and how to add it to a scene...
Grow some hair and it'll become evident. :) Seriously though, neither do I. What is your intent?
"im working on a fps game"
It doesn't help a lot to guess where to put it.
var blockPrefab : GameObject;
var gridX : int = 5;
var gridY : int = 5;
var spacing : float = 1;
function Start()
{
for(var y = 0; y < gridY; y++)
{
for (var x = 0; x < gridX; x++)
{
var pos = Vector3(x, 0, y) * spacing;
Instantiate(blockPrefab, pos, Quaternion.identity);
}
}
}