Camilledrain_LUA

fall racing

Dec 31st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.93 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAfkDeath(true)
  4. tfm.exec.disableAutoScore(true)
  5. tfm.exec.disablePhysicalConsumables(true)
  6. tfm.exec.disableMortCommand(true)
  7. tfm.exec.disableDebugCommand(true)
  8. tfm.exec.disableMinimalistMode(true)
  9. tfm.exec.setRoomMaxPlayers(24)
  10. xml2=''
  11. creator=""
  12. position=0
  13. objective=60
  14. enabled=false
  15. map=""
  16. mapas={"@7411648","@7568910","@7410842","@7568917","@7568919","@7568922","@7568923","@7568928","@7568964","@7568967","@7568965","@7354962","@7569413"}
  17. system.disableChatCommandDisplay("obj")
  18. lobby="@7404106"
  19. changed=false
  20. function eventChatCommand(name,message)
  21.     if(message:sub(1,3) == "obj") then
  22.         if name == "Jhinsword350#0000" or name == "Vaicntaefeto#0000" then
  23.             objective=tonumber(message:sub(5))
  24.             tfm.exec.chatMessage("<J>Objective changed to: "..objective,nil)
  25.         end
  26.     end
  27. end
  28. function eventNewGame()
  29.     if enabled == true then
  30.         position=0
  31.         if changed == false and enabled == true then
  32.             xml2=tfm.get.room.xmlMapInfo.xml
  33.             creator=tfm.get.room.xmlMapInfo.author
  34.             map=tfm.get.room.currentMap
  35.             ui.addTextArea(0,"",nil,-800,-400,2400,1200,0x6a7495,0x6a7495,1.0,true)
  36.             ui.setMapName("<J>Loading map. Please wait...<")
  37.         else
  38.             ui.removeTextArea(0,nil)
  39.         end
  40.     else
  41.         ui.addTextArea(10,"<font face='Eras Demi ITC'><font color='#00ffff'><font size='47'>Fall Racing 2.1",nil,330,42,400,100,0,0,1.0,true)
  42.         ui.setMapName("Welcome to Fall Racing 2.1! Script made by <b>Vaicntaefeto#0000</b>.<")
  43.         tfm.exec.setGameTime(60)
  44.     end
  45. end
  46. function eventLoop(p,f)
  47.     if p >= 5000 and p <= 6000 and changed == false and enabled == true then
  48.         tfm.exec.newGame(xml2)
  49.         changed=true
  50.         ui.setMapName("<J>#fall 2.1   <BL>|   <J>"..creator.." <BL>- "..map.."   <BL>|   <J>Objective : <J>"..objective.." points<")
  51.     end
  52.     if f <= 1 and enabled == true then
  53.         changed=false
  54.         tfm.exec.newGame(mapas[math.random(#mapas)])
  55.     end
  56.     if enabled == false and f >= 1000 then
  57.         ui.addTextArea(11,"<font face='Eras Demi ITC'><font size='18'><font color='#ffff00'>Get ready! The match will start on "..math.floor(f/1000).." seconds.",nil,220,370,600,32,0,0,1.0,true)
  58.     end
  59.     if f <= 10000 and f >= 9000 and enabled == false then
  60.         for name,player in pairs(tfm.get.room.playerList) do
  61.             tfm.exec.setPlayerScore(name,0,false)
  62.             changed=false
  63.         end
  64.     end
  65.     if f <= 1 and enabled == false then
  66.         for i=10,11 do
  67.             ui.removeTextArea(i,nil)
  68.         end
  69.         enabled=true
  70.         tfm.exec.newGame(mapas[math.random(#mapas)])
  71.         for name,player in pairs(tfm.get.room.playerList) do
  72.             tfm.exec.setPlayerScore(name,0,false)
  73.         end
  74.     end
  75.     for name,player in pairs(tfm.get.room.playerList) do
  76.         if tfm.get.room.playerList[name].score >= objective and enabled == true then
  77.             enabled=false
  78.             tfm.exec.newGame(lobby)
  79.             tfm.exec.chatMessage("<VP><b>Congratulations!</b> "..name.." wins the game with "..tfm.get.room.playerList[name].score.." points!")
  80.         end
  81.     end
  82. end
  83. function eventPlayerWon(name)
  84.     position=position+1
  85.     if position == 1 then
  86.         tfm.exec.setGameTime(20)
  87.     end
  88.     if position <= 8 then
  89.         tfm.exec.setPlayerScore(name,10-position,true)
  90.     else
  91.         tfm.exec.setPlayerScore(name,1,true)
  92.     end
  93. end
  94. function eventPlayerDied(name)
  95.     if tfm.get.room.playerList[name].x > 2400 then
  96.         tfm.exec.respawnPlayer(name)
  97.         tfm.exec.giveCheese(name)
  98.         tfm.exec.playerVictory(name)
  99.     end
  100. end
  101. function eventNewPlayer(name)
  102.     if enabled == false then
  103.         ui.addTextArea(10,"<font face='Eras Demi ITC'><font color='#00ffff'><font size='47'>Fall Racing 2.1",nil,330,42,400,100,0,0,1.0,true)
  104.         ui.setMapName("Welcome to Fall Racing 2.1! Script made by <b>Vaicntaefeto#0000</b>.<")
  105.     end
  106.     tfm.exec.chatMessage("<J>Welcome to the #fall2 module!<br><br>The objective of this room is fall to the end of the map!<br>The player that score more points will win the game!<br><br><R>WARNING: This script require at least 3GB of RAM to work without problems.<J><br><br>Script made by Vaicntaefeto#0000",name)
  107. end
  108. tfm.exec.newGame(lobby)
Add Comment
Please, Sign In to add comment