Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = {}
- ktimer = 0
- function eventNewPlayer(name)
- for name,player in pairs(tfm.get.room.playerList) do
- data[name] = {
- ["c"]=0,
- tempo=os.time(),
- }
- end
- tfm.exec.bindKeyboard(name,40,true,true)
- tfm.exec.bindKeyboard(name,39,true,true)
- tfm.exec.bindKeyboard(name,37,true,true)
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- tfm.exec.setPlayerScore(name,0,false)
- end
- function eventKeyboard(name,key,down,x,y)
- if key == 40 and data[name].tempo < os.time()-10000 then
- data[name].c=1
- data[name].tempo = os.time();
- end
- if data[name].c == 1 and key == 39 or data[name].c == 1 and key == 37 then
- tfm.exec.setPlayerScore(name,1,false)
- data[name].c=0
- if os.time() > ktimer then
- local right = tfm.get.room.playerList[name].isFacingRight
- for i = 1,100 do
- tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y-2,(right and 5 or -5))
- tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y-1,(right and 5 or -5))
- tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y-0,(right and 5 or -5))
- tfm.exec.displayParticle(9,(x + (right and 5 or -5)) + (right and math.sqrt(i*2)*4 or -math.sqrt(i*2)*4),y+1,(right and 5 or -5))
- end
- ktimer = os.time() + 500
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement