Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. -- Testador de IDs
  2. -- Escrito por Ninguem
  3.  
  4. adm = {"Ninguem"}
  5. id = 0
  6. objeto = 0
  7. modo = "shaman"
  8.  
  9. function isAdm(p)
  10. for v, i in pairs(adm) do
  11. if p == i then
  12. return true
  13. end
  14. end
  15. return false
  16. end
  17.  
  18. function eventNewGame()
  19. ui.addTextArea(0, "<p align='center'><font size='40px'><a href='event:-1'>-1</a>\n<a href='event:-10'>-10</a>\n<a href='event:-100'>-100</a>\n<a href='event:-1000'>-1000</a>", nil, 5, 150, 150, 400, 0, 0, 0, true)
  20. ui.addTextArea(1, "<p align='center'><font size='40px'><a href='event:+1'>+1</a>\n<a href='event:+10'>+10</a>\n<a href='event:+100'>+100</a>\n<a href='event:+1000'>+1000</a>", nil, 645, 150, 150, 400, 0, 0, 0, true)
  21. ui.addTextArea(2, "<p align='center'><a href='event:replay'><font size='20px'>De novo", nil, 200, 350, 400, 50, 0, 0, 0, true)
  22. invocacao()
  23. end
  24.  
  25. function invocacao()
  26. ui.addTextArea(3, "<p align='center'><font size='40px'>id: " .. id, nil, 0, 50, 800, 50, 0, 0, 0, true)
  27. tfm.exec.removeObject(objeto)
  28. tfm.exec.addShamanObject(26, 400, 500, 0, 0, 0, false)
  29. tfm.exec.addShamanObject(27, 400, 500, 0, 0, 0, false)
  30. tfm.exec.removePhysicObject(0)
  31. if modo == "shaman" then
  32. objeto = tfm.exec.addShamanObject(id, 400, 200, 0, 0, 0, false)
  33. elseif modo == "particula" then
  34. for i=1, 20 do
  35. tfm.exec.displayParticle(id, 400, 200, (math.random(30)-15)/5, (math.random(10)-5)/5, 0, 0)
  36. end
  37. elseif modo == "piso" then
  38. tfm.exec.addPhysicObject(0, 400, 200, {type=id, width=80, height=80, color=0})
  39. end
  40. end
  41.  
  42. function eventTextAreaCallback(ta, p, link)
  43. if isAdm(p) then
  44. if link ~= "replay" then
  45. id = id + tonumber(link, 10)
  46. end
  47. invocacao()
  48. end
  49. end
  50.  
  51. function eventChatCommand(p, cmd)
  52. if isAdm(p) then
  53. if cmd == "shaman" or cmd == "piso" or cmd == "particula" then
  54. modo = cmd
  55. else
  56. id = tonumber(cmd) or 0
  57. end
  58. invocacao()
  59. end
  60. end
  61.  
  62. tfm.exec.disableAutoNewGame(true)
  63. tfm.exec.disableAutoShaman(true)
  64. tfm.exec.newGame([[<C><P /><Z><S><S L="800" o="324650" H="50" X="400" Y="375" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="400" o="324650" H="150" X="400" Y="375" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="453" X="398" /></D><O /></Z></C>]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement