Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.85 KB | None | 0 0
  1. laser = 0
  2. hp = 10
  3. ch = 1
  4. chc = 0
  5. a = -5
  6. by = 200
  7.  
  8. tfm.exec.disableAutoShaman(true)
  9. tfm.exec.disableAutoNewGame(true)
  10.  
  11. function eventNewPlayer(name)
  12.  tfm.exec.bindKeyboard(name, 17, true, true)
  13.  tfm.exec.bindKeyboard(name, 32, true, true)
  14. end
  15.  
  16. for name,player in pairs(tfm.get.room.playerList) do
  17.  eventNewPlayer(name)
  18. end
  19.  
  20. tfm.exec.newGame('<C><P /><Z><S><S H="440" L="10" o="6a7495" X="495" c="3" Y="221" T="12" P="1,100,0,0.5,0,0,0,0" /><S H="10" L="1000" o="6a7495" X="0" c="3" Y="0" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="510" X="236" H="10" Y="93" T="1" P="0,0,0,0.2,-20,0,0,0" /><S P="0,0,0,5000,0,0,0,0" L="10" o="6a7495" X="-5" c="3" Y="287" T="12" H="230" /><S P="0,0,0.3,0,0,0,0,0" L="220" H="50" c="1" Y="413" T="0" X="111" /></S><D><T Y="388" X="43" /></D><O><O C="11" Y="12" X="494" P="30" /><O C="11" Y="432" P="0" X="496" /></O></Z></C>')
  21.  
  22. function eventKeyboard(name,key,down,x,y)
  23.  if key == 17 and ch == 1 then
  24.   print("y = "..y.." by = "..by)
  25.   ch = 0
  26.   laser = x
  27.   if y-70 < by and y > by then
  28.    hp = hp-1
  29.    print("hit!")
  30.   end
  31.   for i=1,150 do
  32.    if tfm.get.room.playerList[name].isFacingRight then
  33.     tfm.exec.displayParticle(13, laser, y-10, 0, 0, 0, 0, nil)
  34.     laser = laser + 5
  35.    else
  36.     laser = laser - 5
  37.    end
  38.   end
  39.  elseif key == 32 then
  40.   tfm.exec.movePlayer(name, 0, 0, false, 0, -50, false)
  41.  end
  42. end
  43.  
  44. function eventPlayerDied(name)
  45.  if name == "Krolu" then
  46. tfm.exec.respawnPlayer(name)
  47. end
  48. end
  49.  
  50. function eventLoop()
  51.  if a == 2 then
  52.   a = 0
  53.   by = math.random(10,300)
  54.   ui.addTextArea(2, "boss", nil, 670, by, 50, 50, nil, nil, 0.5)
  55.   tfm.exec.addShamanObject(20, 650, by, 0, nil,nil, false)
  56.  else
  57.   a = a+1
  58.  end
  59.  ui.addTextArea(1, "Boss hp = "..hp, nil, nil, nil, nil, nil, nil, nil, 1)
  60.  if chc == 0 and ch == 0 or chc == 1 and ch == 0 then
  61.   chc = chc+1
  62.  else
  63.   chc = 0
  64.   ch = 1
  65.  end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement