Transformice - Random vampire

By Jordy19 on Dec 07, 2014

This script was requested by someone.
It picks a random player each round and makes the player a vampire.

Edit (1): Bug fixed.

-- Random vampire
-- author: Jordynl

function randomPlayer()
    local players = {}
    for k,v in pairs(tfm.get.room.playerList) do
        table.insert(players, k)
    end
    return players[math.random(#players)] 
end

function eventNewGame()
    tfm.exec.setVampirePlayer(randomPlayer())
end

Comments

Sign in to comment.
dma   -  Mar 05, 2016

cool stuff not big .. it's nice n clean

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.