Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 24/10/2015
- --Last update: 17/05/2016
- --[[ Notes:
- Does:
- Uma api ( API() ) que retorna o dado necessário do jogador.
- Args:
- name --> Nome do jogador
- data --> Dados do jogador:
- cheese --> Queijos coletados
- first --> Firsts já conseguidos
- shaman --> Quantas vezes já foi shaman
- rounds --> Rounds já jogados
- easy --> Ratos salvos em EasyMode
- hard --> Ratos salvos em HardMode
- divine --> Ratos salvos em DivineMode
- death --> Mortes
- scheese --> Quantas vezes já pegou o queijo como shaman
- time --> Tempo de jogo
- ]]--
- mice = {}
- gcheese = 0
- eventNewPlayer=function(n)
- if not mice[n] then
- mice[n] = {
- cheese = 0, first = 0, shaman = 0, rounds = 0, easy = 0, hard = 0, divine = 0, death = 0, schesse = 0, time = 0
- }
- end
- end
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- eventNewGame=function()
- gcheese = 0
- for n,v in next,tfm.get.room.playerList do
- mice[n].rounds = mice[n].rounds + 1
- if v.isShaman then
- mice[n].shaman = mice[n].shaman + 1
- end
- end
- end
- eventPlayerWon=function(n)
- mice[n].cheese = mice[n].cheese + 1
- if not tfm.get.room.playerList[n].isShaman then
- gcheese = gcheese + 1
- if gcheese == 1 then
- mice[n].first = mice[n].first + 1
- end
- else
- mice[n].scheese = mice[n].scheese + 1
- end
- for k,v in next,tfm.get.room.playerList do
- if v.isShaman then
- if v.shamanMode == 0 then
- mice[n].easy = mice[n].easy + 1
- end
- if v.shamanMode == 1 then
- mice[n].hard = mice[n].hard + 1
- end
- if v.shamanMode == 2 then
- mice[n].divine = mice[n].divine + 1
- end
- end
- end
- end
- eventPlayerDied=function(n)
- mice[n].death = mice[n].death + 1
- end
- eventLoop=function()
- for n in next,tfm.get.room.playerList do
- mice[n].time = mice[n].time + .5
- end
- end
- API = function(name,data)
- if mice[name] then
- if mice[name][data] then
- return mice[name][data]
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement