Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1.  
  2. function eventPlayerWon(pN)
  3. tfm.exec.newGame(7016471)
  4. tfm.exec.movePlayer(pN, 500, 100)
  5. tfm.exec.setUIMapName("Winner room\n")
  6.  
  7. string = "ui.addText pN" -- put text here
  8. roomRecordInt = 0
  9.  
  10.  
  11.  
  12. randomColorforString = {
  13. {c="#f7f918", b="#ec4848"}, -- gradient table
  14. {c="#4ce7f7", b="#2c9f5b"},
  15. {c="#4bd9cd", b="#2a64e9"},
  16. {c="#d4f31a", b="#8c8fa4"},
  17. {c="#8f47c1", b="#5512e5"},
  18. }
  19.  
  20. function ui.addText(string, x, y, color, border, name)
  21. ui.addTextArea(9, string.format(string, border), nil, x, y-1, 900, 25, nil, nil, 0, true, name) -- edit just 900 and 25 (x and y position)
  22. ui.addTextArea(10, string.format(string, border), nil, x, y+1, 900, 25, nil, nil, 0, true, name)
  23. ui.addTextArea(11, string.format(string, border), nil, x+1, y, 900, 25, nil, nil, 0, true, name)
  24. ui.addTextArea(12, string.format(string, border), nil, x-1, y, 900, 25, nil, nil, 0, true, name)
  25. ui.addTextArea(13, string.format(string, color), nil, x, y, 900, 25, nil, nil, 0, true, name)
  26. end
  27.  
  28. function eventNewGame()
  29. randomColors = randomColorforString[math.random(#randomColorforString)]
  30. playerList = tfm.get.room.playerList
  31. toggle = true
  32. i = 0
  33. for p, n in pairs(playerList) do
  34. eventNewPlayer(p)
  35. ui.addText("<font color='%s'><b>"..string.."</font>", 10, 382, randomColors.c, randomColors.b, p)
  36. end
  37. end
  38.  
  39. function eventNewPlayer(name)
  40. randomColors = randomColorforString[1]
  41. ui.addText("<font color='%s'><b>"..string.."</font>", 10, 382, randomColors.c, randomColors.b, name)
  42. end
  43.  
  44. for k, v in pairs(tfm.get.room.playerList) do
  45. eventNewPlayer(k)
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement