Author Topic: Does anyone know the respawn command in script?  (Read 2790 times)

/title

Like for minigames or stuff

Is it
Code: [Select]
function respawn(%client)
{
    findclientbyname(%client.bl_id).spawnplayer();
}
or something

Code: [Select]
function respawn(%client)
{
   %client.instantRespawn();
}

Code: [Select]
%client.player.instantRespawn();
Edit: This won't work if there player is already dead.
« Last Edit: January 26, 2015, 04:01:40 AM by Honorabl3 »

Code: [Select]
%client.player.instantRespawn();

How does that make sense to you? What if they're dead?

How does that make sense to you? What if they're dead?
I was fixing the code above. And what do you mean? instantRespawn should respawn players even if they're dead?

Edit: Tbh, I didn't know client had a method for instantRespawn
« Last Edit: January 26, 2015, 04:03:15 AM by Honorabl3 »

%client.player won't exist if they're dead.

Woah, I need to stop the shrooms

It's GameConnection::spawnPlayer().

Code: [Select]
%client.spawnPlayer();

/title

Like for minigames or stuff

Is it
Code: [Select]
function respawn(%client)
{
    findclientbyname(%client.bl_id).spawnplayer();
}
or something
You don't input a BL ID for find client by NAME. Plus you don't need to find the client because you already have it.

Wait, so do I just do
Code: [Select]
function GameConnection::spawnPlayer()
{
    %client.spawnPlayer();
}
Do I add the %client argument to the gameconnection or how does that work?
« Last Edit: January 27, 2015, 10:41:40 PM by Courage »

What exactly are you trying to do?

What exactly are you trying to do?

I'm not sure how to say this... I'm trying to respawn a player after it's "team person" has been changed in a minigame. So it fully refreshes the player.

Wait, so do I just do
Code: [Select]
function GameConnection::spawnPlayer()
{
    %client.spawnPlayer();
}
Do I add the %client argument to the gameconnection or how does that work?
You don't need to define a function, it already exists
Especially the way you did it, that'll just cause infinite recursion

%client.spawnPlayer(); is all you need to do

You don't need to define a function, it already exists
Especially the way you did it, that'll just cause infinite recursion

%client.spawnPlayer(); is all you need to do

Oh thanks!