Author Topic: Last Man Alive Detection  (Read 1365 times)

Is there a way for slayer that I can make a script that detects the Last Man Alive (for team 1) and get the clients name, and say something on the screen?


Make a simset group.
why is this nessescary
It isn't

You don't need a simset

Make a simset group.

whats a simset group?

(im still a beginner, some come easy on me please)

Well, their is multiple ways of doing it, but using a simset group would be most efficient (in my opinion). It would save their player objects to the list, and if a player dies, they're player gets deleted off the list. And you can just do a check to see if the list is down to 1 person. If so, then it will get that players object, and congratulate him for winning.

Why use a simset when minigames already have a list of all players?

OP, tell me what you're trying to do exactly. Are you using Slayer?

Why use a simset when minigames already have a list of all players?

OP, tell me what you're trying to do exactly. Are you using Slayer?

Im doing a Jail RP, and whenever the last prisoner alive, they can type a command and select a player (Guard) and a minigame, such as like, spear battle, or sword DM, and the server teleports the selected guard and prisoner to the mini arena.


You can package the Slayer_MinigameSO::victoryCheck_lives(%this) function.

Return values:
  • -1 There are still multiple people standing, continue the round.
  • 0 Everybody is dead, end round.
  • object It will return a client or team object if they are the last one standing, end round.
Hint: Look at the value that the parent returns to check if there is one person left.
Hint: Return -1 in your package if you wish to prevent the round from ending.



Can you figure out where to go from there?



Some additional functions that are useful but you might not need:
%mini.getLiving() - returns living member count
%team.getLiving() - returns living member count of team
%team.getSpawned() - returns number of members on team that have a player
%client.dead() - Determines if a client can respawn.
%client.setDead(bool) - Sets whether a client can respawn or not.
« Last Edit: March 15, 2013, 07:30:39 PM by Greek2me »