Author Topic: Prevent player respawn in 'spectator mode'  (Read 1085 times)

I'm using the script below to make players spectate the winner of a minigame at the end of each round. The problem is that the spectators are able to respawn by clicking - how can I prevent the spectators from respawning?

Code: [Select]
%member.player.delete();
%member.camera.setOrbitMode(%winner.player, %winner.player.getTransform(), 0.5, 10, 10, false);
%member.setControlObject(%member.camera);

You may have better luck breaking out of the spawning method before it is called. I think it's GameConnection::onSpawn or Armor::onSpawn. If you find the right method, simply check for a variable and if its wrong, you can easily return out of it

You may have better luck breaking out of the spawning method before it is called. I think it's GameConnection::onSpawn or Armor::onSpawn. If you find the right method, simply check for a variable and if its wrong, you can easily return out of it

There's something called gameConnection::spawnPlayer

package observer ontrigger