Advertisement
Guest User

Nyan Script by Cosmydavid

a guest
Nov 23rd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. tfm.exec.disableAutoShaman(true)
  2. tfm.exec.newGame("@2881168")
  3. tfm.exec.disableAutoNewGame(true)
  4.  
  5. tfm.exec.setNameColor('Cosmydavid', 0xFFA100)
  6.  
  7. tfm.exec.disableAfkDeath(true)
  8.  
  9.  
  10. function eventPlayerDied(name) tfm.exec.respawnPlayer(name) end function eventNewPlayer(name) tfm.exec.respawnPlayer(name) end function eventPlayerWon(name) tfm.exec.respawnPlayer(name) end
  11.  
  12. tfm.exec.disableAutoNewGame(true)
  13. tfm.exec.disableAutoShaman(true)
  14.  
  15. tfm.exec.setUIMapName("<font color='#56BFE4'>Nyan <font color='#60608F'>|</font> <font color='#ffffff'>Creator :</font> <font color='#56BFE4'> Cosmydavid</font>")
  16.  
  17. lights={1,2,4,9,11,13}
  18. delay=os.time()
  19. firework_x,firework_y=400,380
  20. blast_x,blast_y=400,200
  21. trail=0
  22. divisions=0
  23. done=false
  24. f=0
  25.  
  26. function eventNewPlayer(name)
  27. system.bindMouse(name,true)
  28. end
  29.  
  30. for name in pairs(tfm.get.room.playerList) do
  31. eventNewPlayer(name)
  32. end
  33.  
  34. function eventMouse(name,x,y)
  35. if first_person==nil and f==0 then
  36. first_person=name
  37. firework_x=x
  38. firework_y=y
  39. else
  40. local vx,vy
  41. blast_x=x
  42. blast_y=y
  43. trail_x=firework_x
  44. trail_y=firework_y
  45. divisions_x=(blast_x-firework_x)/10
  46. divisions_y=(blast_y-firework_y)/10
  47. if divisions_x<0 then divisions_x=0-(divisions_x) end
  48. if divisions_y<0 then divisions_y=0-(divisions_y) end
  49. divisions=divisions_x>divisions_y and divisions_y or divisions_x
  50. divisions=math.floor(divisions+0.5)
  51. if divisions%2==1 then
  52. divisions=divisions+1
  53. end
  54. path_x=(blast_x-firework_x)/divisions
  55. path_y=(blast_y-firework_y)/divisions
  56. end
  57. end
  58.  
  59. function eventLoop(ct,tr)
  60. if trail<divisions then
  61. for i=1,2 do
  62. for i=1,3 do
  63. vx=math.random()+math.random(-1,1)
  64. vy=math.random()+math.random(-1,1)
  65. tfm.exec.displayParticle(lights[math.random(#lights)],trail_x,trail_y,vx,vy,0,0)
  66. end
  67. trail_x=trail_x+path_x
  68. trail_y=trail_y+path_y
  69. trail=trail+1
  70. end
  71. end
  72. if trail>0 and trail==divisions then
  73. done=true
  74. trail=0
  75. divisions=0
  76. end
  77. if done then
  78. for i=1,(math.random(20,100)) do
  79. local vx,vy
  80. vx=math.random()+math.random(-1,1)
  81. vy=math.random()+math.random(-1,1)
  82. tfm.exec.displayParticle(lights[math.random(#lights)],blast_x,blast_y,vx,vy,0,0)
  83. end
  84. done=false
  85. f=1
  86. time=os.time()
  87. end
  88. if f==1 and time<os.time()-300 then
  89. local x,y,vx,vy
  90. for i=1,math.random(13) do
  91. x=blast_x+math.random(-40,40)
  92. y=blast_y+math.random(-40,40)
  93. for i=1,math.random(7) do
  94. vx=math.random()+math.random(-1,1)
  95. vy=math.random()+math.random(-1,1)
  96. tfm.exec.displayParticle(lights[math.random(#lights)],x,y,vx,vy,0,0)
  97. end
  98. end
  99. f=math.random(0,1)
  100. if f==0 then first_person=nil end
  101. end
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement