Help with certain people not get teleported

I have a spectate feature for my game and I also have teleporters that teleports every body In the game, I would want it to if ur spectating u can’t get teleported but the other people not dead will still get teleported or another way if ur spectating and u get teleported u will still be spectating in the next part any ideas?

This should be relatively straightforward assuming you have a way of differentiating different player states throughout each round’s run (alive, dead/spectating). Just don’t teleport the dead players around.

Do you already have an implementation down? More context is needed to give better help, such as what code you have right now and what attempts you’ve made in trying to do this yourself.

1 Like

Sorry Let me explain more I have a horror game and I want it where once you die you can spectate other players but if a player goes on the teleporter it’s just gonna teleport them to and bring them alive and I don’t have the script rn but I know vids about it

I don’t have a way describing dead or alive players

That should be the first thing you work on then; getting a script, let alone some code down that’s able to determine who’s actually alive (and, unless you have any intermediate states a player can be in, anyone else can be assumed as a dead or spectating player). Without those, you’re jumping ahead by trying to make a system that’s dependent on knowing the player’s game state to begin with.

Otherwise, with the explanation, I think I follow. Let me know if I have this right: I’m not sure how the game begins, but when players die they should be sent to a lobby and when they step on a teleporter they should be made alive again. Is that right?

If the above is right, then you’d still need a way to differentiate who’s alive or not to control that kind of logic, like where a player’s going to spawn next or how to turn them alive again and then send them to the place where other alive players are.

Using Teams a very primitive example of describing who’s alive or not and is still pretty widely used. You control when players are alive by setting their team to alive and then for all alive players, when they die change their team to the lobby one which would effectively put them in the spectating state. For an instanceless solution, this would be done with dictionaries.

1 Like