Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- laser = 0
- hp = 10
- ch = 1
- chc = 0
- a = -5
- by = 200
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- function eventNewPlayer(name)
- tfm.exec.bindKeyboard(name, 17, true, true)
- tfm.exec.bindKeyboard(name, 32, true, true)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- 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>')
- function eventKeyboard(name,key,down,x,y)
- if key == 17 and ch == 1 then
- print("y = "..y.." by = "..by)
- ch = 0
- laser = x
- if y-70 < by and y > by then
- hp = hp-1
- print("hit!")
- end
- for i=1,150 do
- if tfm.get.room.playerList[name].isFacingRight then
- tfm.exec.displayParticle(13, laser, y-10, 0, 0, 0, 0, nil)
- laser = laser + 5
- else
- laser = laser - 5
- end
- end
- elseif key == 32 then
- tfm.exec.movePlayer(name, 0, 0, false, 0, -50, false)
- end
- end
- function eventPlayerDied(name)
- if name == "Krolu" then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventLoop()
- if a == 2 then
- a = 0
- by = math.random(10,300)
- ui.addTextArea(2, "boss", nil, 670, by, 50, 50, nil, nil, 0.5)
- tfm.exec.addShamanObject(20, 650, by, 0, nil,nil, false)
- else
- a = a+1
- end
- ui.addTextArea(1, "Boss hp = "..hp, nil, nil, nil, nil, nil, nil, nil, 1)
- if chc == 0 and ch == 0 or chc == 1 and ch == 0 then
- chc = chc+1
- else
- chc = 0
- ch = 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement