You should really indent your code, it helps us (and you) read the script easier,.
Basically the GS2 equivalent is:
PHP Code:
function onWeaponFired()
{
play("put.wav");
player.bombs--;
if (player.dir == 0) {
temp.i = putnpc2(player.x + 0.5, player.y - 1, "");
temp.i.join("classname");
}
else if (player.dir == 1) {
temp.i = putnpc2(player.x - 1.5, player.y + 1, "");
temp.i.join("classname");
}
else if (player.dir == 2) {
temp.i = putnpc2(player.x + 0.5, player.y + 2.5, "");
temp.i.join("classname");
}
else if (player.dir == 3) {
temp.i = putnpc2(player.x + 2.5, player.y + 1, "");
temp.i.join("classname");
}
}
Now all you have to do is add the script for the bomb inside the class from the .txt file.
Also, it should be:
serverwarp(this.selectedserverconnect);