Overjoy06

Vampires vs. Humans

Sep 16th, 2020
1,056
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tfm.exec.disableAutoShaman(true)
  2. tfm.exec.newGame("@7466611")
  3. local arrows = {}
  4. local MAX_ARROWS = 10
  5. local ARROW_FORCE = 40
  6.  
  7. local timer = 0
  8. local TIMER_LOOPAT = 8
  9.  
  10. function showArrows(n)
  11. ui.addTextArea(1, "<font size='20'>Arrows: " .. arrows[n], n, 10, 20, nil, nil, 0x000000, 0x2e2e2e, 0.6, true)
  12. end
  13.  
  14. function eventNewPlayer(n)
  15. arrows[n] = MAX_ARROWS
  16.  
  17. showArrows(n)
  18. system.bindMouse(n, true)
  19. end
  20.  
  21. function eventMouse(n, x, y)
  22. local data = tfm.get.room.playerList[n]
  23.  
  24. if not data.isDead and arrows[n] > 0 and data.isVampire == false then
  25. local angle = math.atan2(y - data.y, x - data.x)
  26.  
  27. tfm.exec.addShamanObject(
  28. 35,
  29. data.x + 50 * math.cos(angle),
  30. data.y + 50 * math.sin(angle),
  31. math.deg(angle),
  32. math.cos(angle) * ARROW_FORCE,
  33. math.sin(angle) * ARROW_FORCE
  34. )
  35.  
  36. arrows[n] = arrows[n] - 1
  37. showArrows(n)
  38. end
  39. end
  40.  
  41. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  42.  
  43. players = {}
  44. for name,player in pairs(tfm.get.room.playerList) do
  45. table.insert(players,name)
  46. end
  47. tfm.exec.setUIMapName("<font color='#FFFFFF'><font size='13px'>Welcome to the vampire module. We made it for the tribe, Have fun!")
  48. tfm.exec.disableMortCommand(true)
  49. tfm.exec.disableAutoNewGame(true)
  50. tfm.exec.disableAfkDeath(false)
  51. function eventTextAreaCallback(id,n,ev)
  52. if ev=="click1" then
  53. ui.addTextArea(2,"<p align='center'><font color='#00ffff'><font size='13px'><a href='event:click2'>Overjoy06</a></font></p>",nil,695,100,100,20, 0x000000, 0x00ffff,1,true)elseif ev=="click2" then
  54. ui.addTextArea(3,"<p align='center'><font color='#FFFB00'><font size='13px'><a href='event:close'>Have Fun!</a></font></p>",nil,695,150,100,20, 0x000000, 0xFFFB00,1,true)
  55. elseif ev=="close" then
  56. for i=2,4 do ui.removeTextArea(i) end end
  57. end
  58.  
  59. ui.addTextArea(4,"<p align='center'><font color='#ff0000'><font size='13px'><a href='event:click1'>Made By</a></font></p>",nil,695,50,100,20, 0x000000, 0xff0000,1,true)
  60. tfm.exec.setUIMapName("<font color='#FFFFFF'>Welcome to the tribe module 'Vampires vs. Mices' ")
  61.  
  62. local blue, red = {}, {}
  63. local inBlue = false
  64. local blueRespawn = { x = 790 , y = 380 }
  65. local redRespawn = { x = 189, y = 347 }
  66.  
  67. function eventNewPlayer(name)
  68. inBlue = not inBlue
  69. if inBlue then
  70. blue[name] = true
  71. else
  72. red[name] = true
  73. end
  74. end
  75.  
  76. for n in next, tfm.get.room.playerList do
  77. eventNewPlayer(n)
  78. end
  79.  
  80. function eventNewGame()
  81. for n in next, blue do
  82. tfm.exec.movePlayer(n, blueRespawn.x, blueRespawn.y)
  83. end
  84.  
  85. for n in next, red do
  86. tfm.exec.movePlayer(n, redRespawn.x, redRespawn.y)
  87. end
  88. end
  89. for players in pairs(red) do
  90. tfm.exec.setVampirePlayer(players)
  91. end
  92.   for n in next, tfm.get.room.playerList do
  93.     -- If player is in the blue team then they can fly/vamp.
  94.  
  95.     if blue[n] then
  96.       system.bindKeyboard(n, 32, true, false)
  97.     elseif red[n] then
  98.       tfm.exec.setVampirePlayer(n)
  99.       system.bindKeyboard(n, 32, true, true)
  100.     end
  101.   end
  102.  
  103. function eventKeyboard(n, key, down, x, y)
  104.  
  105.   if y > 0 then
  106.     tfm.exec.movePlayer(n, 0, 0, true, 0, -50, false)
  107.   end
  108. end
  109.  
  110. eventNewGame()
  111. for name,player in pairs(tfm.get.room.playerList) do
  112. if name == "Overjoy06#0000" then
  113. ui.addTextArea(6, "Welcome <font color='0022FF'>Overjoy06#0000 (The Creator)", nil, 0, 150, 800, 100, 0x0a0a0a, 0x0a0a0a, 0, true)
  114. end
  115. end
  116. for name,player in pairs(tfm.get.room.playerList) do
  117. if name == "Zad#8091" then
  118. ui.addTextArea(7, "Welcome <font color='0022FF'>Zad#8091 (The Vampire Leader)", nil, 0, 165, 800, 100, 0x0a0a0a, 0x0a0a0a, 0, true)
  119. end
  120. end
  121. for name,player in pairs(tfm.get.room.playerList) do
  122. if name =="Haxor_333#0000" then
  123. ui.addTextArea(8, "Welcome <font color='0022FF'>Haxor_333#0000 (The Idea Maker)", nil, 0, 180, 800, 100, 0x0a0a0a, 0x0a0a0a, 0, true)
  124. end
  125. end
  126. ui.addTextArea(9, "Tribe Important People here",nil, 0, 135, 800, 100, 0x0a0a0a, 0x0a0a0a, 0, true)
  127. for name,player in pairs(tfm.get.room.playerList) do
  128. if name =="Adooma_pro#7870" then
  129. ui.addTextArea(10, "Welcome <font color='0022FF'>Adooma_pro#7870 (The Skeletons Leader)", nil, 0, 180, 800, 100, 0x0a0a0a, 0x0a0a0a, 0, true)
  130. end
  131. end
RAW Paste Data