Slowmice

Pictionary [LUA]

Oct 5th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.01 KB | None | 0 0
  1. --[[ PICTIONARY
  2.     Shamans currently have to select arrows and press 'c' to get an anchor, will be changed when anchors come out for the api
  3.     Make floor drop and kill all alive mice?
  4. ]]--
  5.  
  6. debug.disableEventLog(true)
  7. tfm.exec.disableAutoScore(true)
  8. tfm.exec.newGame(3809991)
  9. words = {'cat','sun','cup','ghost','flower','pie','cow','banana','snowflake','bug','book','jar','snake','light','tree','lips','apple','slide','socks','smile','swing','coat','shoe','water','heart','hat','ocean','kite','dog','mouth','milk','duck','eyes','skateboard','bird','boy','apple','person','girl','mouse','ball','house','bed','whale','jacket','shirt','hippo','beach','egg','face','cookie','cheese','cone','drum','circle','spoon','worm','web','horse','door','song','trip','backbone','bomb','round','treasure','garbage','park','pirate','ski','state','whistle','palace','baseball','coal','queen','dominoes','photograph','computer','hockey','aircraft','hot dog','salt','pepper','key','iPad','whisk','frog','lawnmower','mattress','pinwheel','cake','circus','battery','mailman','cowboy','password','bicycle','skate','electricity','lightsaber','deep','spring','nature','shallow','toast','outside','America','roller blades','gingerbread man','bowtie','half','spare','wax','light bulb','platypus','music'}
  10.  
  11. wordmax = table.getn(words)
  12. currentWord = words[math.random(1,#words)]
  13.  
  14. function eventNewGame()
  15. tfm.exec.setGameTime(150, true)
  16.     points = {}
  17.     for p in pairs(tfm.get.room.playerList) do
  18.         points[p] = 0
  19.         tfm.exec.setPlayerScore(p, 0, false)
  20.     end
  21.     tfm.exec.chatMessage('<ROSE>A new round has started!')
  22.     currentWord = words[math.random(1,#words)]
  23.     guessed = false
  24.     for playerName,player in pairs(tfm.get.room.playerList) do
  25.         if(player.isShaman) then
  26.             tfm.exec.chatMessage('<ROSE>You have to draw a <N><b>'..currentWord..'</b>. Make sure to move so you don\'t automatically die!',playerName)
  27.         end
  28.     end
  29. end
  30.  
  31. function eventNewPlayer(playerName)
  32.     tfm.exec.chatMessage('<J>WELCOME TO PICTIONARY! Type !help for info!',playerName)
  33. end
  34.  
  35. function eventChatCommand(playerName,command)
  36.     if command == 'help' then
  37.         tfm.exec.chatMessage('<J>Welcome to Pictionary!',playerName)
  38.         tfm.exec.chatMessage('<J>Every round the shaman is given a word that they must draw, and the mice have to guess it.',playerName) -- no, this is fine. im a nub at this.. remember
  39.         tfm.exec.chatMessage('<J>As a mouse, type <N>!guess <J>into the chat, \'guess\' being your guess as to what the shaman is drawing.',playerName)
  40.     end
  41.     if (command == currentWord) and guessed == false then
  42.         tfm.exec.chatMessage('<ROSE>' .. playerName .. ' guessed correctly! The word was ' .. currentWord)
  43.         tfm.exec.setPlayerScore(playerName, 3, true)
  44.         tfm.exec.movePlayer(playerName,400,200,0,0,0,0)
  45.         tfm.exec.setGameTime(15, true)
  46.         guessed = true
  47.     end
  48. end
  49.  
  50. function eventLoop(time,timeRemaining)
  51.     if timeRemaining <= 5000 then
  52.         tfm.exec.newGame(3809991)
  53.     end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment