Someone has to type !eliminator to start the game
Other people have 20 seconds to join the game by typing !join
If no other user joins in those 20 seconds, you will play against the computer.
alias -l eliminationGame {
var %totalPlayers = $hget(eliminator, 0).item
var %playerEliminated = $hget(eliminator, $r(1, %totalPlayers)).data
hdel eliminator %playerEliminated
msg $1 04 $+ %playerEliminated 12has has been eliminated!
if ($hget(eliminator, 0).item == 1) {
var %survivor = $hget(eliminator, 1).data
msg $1 04 $+ %survivor 12is the only survivor and therefore has won the game of elimination!
unsetEliminationGame
set -z %eliminationCooldown 60
}
}
alias -l eliminationNPCJoin {
if (!%i) set %i 1
if (%i < 6) {
if (!%npcList) set %npcList Vladimir Putin,Barack Obama,Donald J. Trump,Pope Francis,Kim Jong-un,Hillary Clinton
var %randomNPC = $r(1, $numtok(%npcList, 44))
var %npc = $gettok(%npcList, %randomNPC, 44)
%npcList = $deltok(%npcList, %randomNPC, 44)
.timer 1 3 eliminationJoin $1 1 %npc
inc %i
}
else eliminationStart $1
}
alias -l eliminationStart {
if ($hget(eliminator, 0).item == 1) {
msg $1 12Since no one joined the game, the NPCs will join.
eliminationNPCJoin $1
}
else {
var %totalPlayers = $hget(eliminator, 0).item
msg $1 12Elimination game has been started, people will start getting eliminated after every 5 seconds!
.timer $calc(%totalPlayers - 1) 5 eliminationGame $1
}
}
alias -l eliminationJoin {
if (!$hget(eliminator, $2)) {
if ($timer(EliminationStart)) {
hadd eliminator $2 $2
var %totalPlayers = $hget(eliminator, 0).item
msg $1 04 $+ $2 12has joined the game! 04 $+ %totalPlayers 12player(s) joined! You've 04 $+ $timer(EliminationStart).secs 12seconds left to join!
}
if ($3) {
hadd eliminator $3 $3-
msg $1 12NPC 04 $+ $3- 12has joined the game!
eliminationNPCJoin $1
}
}
}
alias -l unsetEliminationGame {
if ($hget(eliminator)) hfree eliminator
unset %npcList %i
}
on *:TEXT:!eliminator:#: {
if (%eliminationCooldown) notice $nick 12The game is currently in cooldown, the game can be started after 04 $+ $duration($v1) $+ 12.
else {
if (!$hget(eliminator)) {
msg # 04 $+ $nick 12has started a game of elimination type 04!join 12to join the game, you've 0420 seconds 12to join.
if (!$hget(eliminator)) hmake eliminator
.timerEliminationStart -o 1 20 eliminationStart #
eliminationJoin # $nick
}
else notice $nick 12there is already a game of elimination going on!
}
}
on *:TEXT:!join:#: {
eliminationJoin # $nick
}
What do you mean? Right now you can only play one instance of the game at a time, as the script isn't built to run multiple instances.