Advertisement
Soristl

Gladiator 1.0

Mar 9th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. ADMIN = "Fulano"
  2.  
  3. function eventChatCommand(jogador, comando)
  4. if comando == "np" and jogador == ADMIN then
  5. tfm.exec.newGame()
  6. end
  7. end
  8.  
  9. function eventTextAreaCallback(id, jogador, callback)
  10. local callbackName, callbackData = table.unpack(string.split(callback, "#"))
  11. if type(_G["onCallback_"..callbackName]) == "function" then
  12. _G["onCallback_"..callbackName](id, jogador, table.unpack(string.split(callbackData or "", ",")))
  13. end
  14. end
  15.  
  16. function string.split(rawString, separator)
  17. splittedString = {}
  18. if rawString and separator then
  19. for str in string.gmatch(rawString, "[^"..separator.."]+") do
  20. table.insert(splittedString, str)
  21. end
  22. end
  23. return splittedString
  24. end
  25.  
  26. function onCallback_showHelp(id, player, page)
  27. ui.updateTextArea(id, "Como funciona o gladiator: Um jogador seleciona um outro jogador e se ele ganhar esse duelo ele permanece no jogo, e escolhe outro adversário acaso perca o duelo ele será automaticamente retirado da sala com isso"..page, player)
  28. end
  29. ui.addTextArea(1,'<a href="event:showHelp#1">Modo de jogo do gladiator</a>', nil, 10, 20, 200, 100)
  30.  
  31. tfm.exec.disablePhysicalConsumables()
  32.  
  33. mapas = {"@7401972"}
  34. tfm.exec.disableAutoShaman() tfm.exec.newGame(mapas[(#mapas)])
  35.  
  36.  
  37. tfm.exec.disableAutoNewGame()
  38. tfm.exec.disableAutoTimeLeft()
  39. tfm.exec.disableAfkDeath(true)
  40.  
  41. map = {w=800,h=400}
  42.  
  43. function checkPlayers()
  44. for name, i in pairs(tfm.get.room.playerList) do
  45. if (i.x > map.w) or (i.x < 10) or (i.y > map.h) or (i.y < 20) then
  46. tfm.exec.killPlayer(name)
  47. end
  48. end
  49. end
  50.  
  51. admin = "Fulano"
  52.  
  53. function eventChatCommand(jogador, comando)
  54. if comando:sub(1,2) == "tp" and jogador == admin then
  55. selecionado = comando:sub(4)
  56. end
  57. end
  58.  
  59. function eventMouse(jogador, x, y)
  60. tfm.exec.movePlayer(selecionado, x, y)
  61. end
  62.  
  63. system.bindMouse(admin, true)
  64.  
  65. function eventPlayerDied(name)
  66. tfm.exec.respawnPlayer(name)
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement