Respawn player after death

Hello

im using the fps constructor from the asset store wich now are a free asset.
Im trying to change one off the scripts so it make the player respawn again instead off after dead player is destroyed and you get trowed back in the main menu in scene 0 again . Since im making a fps multiplayer that should not be like that.
Its written in Java. even if its free im not sure i can upload the script :frowning:

Anyway it says in the script after Death load.applicationlevel 0 and i changed it to the game world but its not working correct.
Hope somone can give me some help in the right direction

After player is Dead and scene 1 is reloaded there is now 2 player prefabs

Don’t copy and paste this, as I don’t know what the variables are, but…

var respawnPoint : Transform;
//blah blah blah
function Update()
{
if(/*player dies*/)
{
health/*or whatever*/ = 100;
ammo = /*starting ammo amount*/;
transform.position = respawnPoint.position;
}
}

So, yeah. Just incorporate the respawn point and reset the ammo and health AND remove the “after death, Application.LoadLevel” stuff. If you need anything else, just tell me.

Also, just a little FYI, it’s written in C#. Unity can’t work with Java, even though the two languages are very much alike.

I thought he meant JavaScript :stuck_out_tongue:

Its not written in C its written in unity’s java . Thx JSierraAKAMC im gonna start trying too make it work