Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.49 KB | None | 0 0
  1. --Strings and Tables and Disables
  2. warrirors = {}
  3. canSkills={}
  4. data={}
  5. dataplayer={}
  6. p={}
  7. toDespawn={}
  8. players={}
  9. idheart1={} idheart2={} idheart3={} idheart4={} idheart5={} idheart6={} idre={}
  10. canFly={}
  11. canKill={}
  12. canSprite={}
  13. idskill={} idskill2={} idskill3={} idskill4={} idskill5={} idskill6={} idskill7={} idle={} idbar={}
  14. mice=0
  15. for _,v in pairs ({'disableAutoScore','disableAutoNewGame','disableAutoShaman','disableDebugCommand','disableMinimalistMode','disableAutoTimeLeft','disableAfkDeath'}) do
  16. tfm.exec[v](true)
  17. end
  18. text={}
  19. lang={}
  20. lang.ar={won="لقد فزت",winner="هو الفائز",skills="مهارات",points="نقاط",waiting="بانتظار اللاعبين",fight="القتال بين",respawn="سوف تعود للحياة هنا",up="تطوير",full="مطّور"}
  21. lang.en={won="You have won",winner="is the Winner",skills="'s Skills",points="'s Points",full="Full",waiting="Waiting players",fight="The fight is between",respawn="You'll respawn here",up="Upgrade"}
  22. commu={"en", "ar"}
  23. maps = {
  24. {code = "@6984519", x = 400, y = 323}
  25. }
  26.  
  27. --Random maps system
  28. function newMap()
  29. map = {}
  30. i = 0
  31. for _,v in pairs(maps) do
  32. i = i + 1
  33. map[i] = v.code
  34. end
  35. tfm.exec.newGame(map[math.random(#map)])
  36. end
  37.  
  38. --Translations system
  39. function setLang(n)
  40. text[n]=lang[tfm.get.room.playerList[n].community] or lang.en
  41. end
  42.  
  43. --Data system
  44. function Dataplayer(n)
  45. for i,dataplayer in ipairs(dataplayer) do
  46. if n==dataplayer then
  47. return true
  48. end
  49. end
  50. return false
  51. end
  52.  
  53. function reData(n)
  54. setLang(n)
  55. data[n]={player=n,score=0,skill1="<p align='center'><b><a href='event:up'>"..text[n].up.."",skill2="<p align='center'><b><a href='event:up2'>"..text[n].up.."",skill3="<p align='center'><b><a href='event:up3'>"..text[n].up.."",skill4="<p align='center'><b><a href='event:up4'>"..text[n].up.."",skill5="<p align='center'><b><a href='event:up5'>"..text[n].up.."",skill6="<p align='center'><b><a href='event:up6'>"..text[n].up.."",skill7="<p align='center'><b><a href='event:up7'>"..text[n].up.."",up1="<p align='center'><b>[<R>•••<N>]",up2="<p align='center'><b>[<R>•••<N>]",up3="<p align='center'><b>[<R>•<N>]",up4="<p align='center'><b>[<R>•••<N>]",up5="<p align='center'><b>[<R>•••<N>]",up6="<p align='center'><b>[<R>•<N>]",up7="<p align='center'><b>[<R>•<N>]",point1=0,point2=0,point3=0,point4=0,point5=0,point6=0,point7=0,counter=0,counter2=0,counter3=0,expp=0,points=50,level=0,maxexp=10,tier1=0,tier2=0,heart=5,retime=0}
  56. end
  57.  
  58. --Warrirors and Hearts system
  59. function Warrirors(n)
  60. for i,warrirors in ipairs(warrirors) do
  61. if n==warrirors then
  62. return true
  63. end
  64. end
  65. return false
  66. end
  67.  
  68. function Hearts(n)
  69. if data[n].heart==5 then
  70. if idheart6[n] then tfm.exec.removeImage(idheart6[n],n) idheart6[n]=nil end
  71. elseif data[n].heart==4 then
  72. if idheart1[n] then tfm.exec.removeImage(idheart1[n],n) idheart1[n]=nil end
  73. elseif data[n].heart==3 then
  74. if idheart2[n] then tfm.exec.removeImage(idheart2[n],n) idheart2[n]=nil end
  75. elseif data[n].heart==2 then
  76. if idheart3[n] then tfm.exec.removeImage(idheart3[n],n) idheart3[n]=nil end
  77. elseif data[n].heart==1 then
  78. if idheart4[n] then tfm.exec.removeImage(idheart4[n],n) idheart4[n]=nil end
  79. elseif data[n].heart==0 then
  80. if idheart5[n] then tfm.exec.removeImage(idheart5[n],n) idheart5[n]=nil end
  81. for index,p in pairs(warrirors) do
  82. tfm.exec.giveCheese(p)
  83. tfm.exec.playerVictory(p)
  84. ui.removeTextArea(21,p)
  85. if idre[p] then tfm.exec.removeImage(idre[p],p) idre[p]=nil end
  86. started=false
  87. end
  88. end
  89. end
  90.  
  91. --Skills functions
  92. function Skills(P,n)
  93. data[n].player=P
  94. canSkills[n]=true
  95. ui.addTextArea(1, "", n, 279, 87, 214, 298, 0x2c555c, 0x936240, 1, true)
  96. ui.addTextArea(2, data[P].up4, n, 440, 250, nil, nil, 0x324650, 0x000000, 0, true)
  97. ui.addTextArea(4, "<b><p align='center'><font size='14'><b><V><b>"..P.." "..text[n].skills.."</b>", n, 267, 57, 235, 20, 0x152d30, 0x152d30, 1, true)
  98. ui.addTextArea(5, data[P].up6, n, 290, 250, nil, nil, 0x324650, 0x000000, 0, true)
  99. ui.addTextArea(11, data[P].up1, n, 445, 340, nil, nil, 0x324650, 0x000000, 0, true)
  100. ui.addTextArea(12, data[P].up2, n, 365, 340, nil, nil, 0x324650, 0x000000, 0, true)
  101. ui.addTextArea(13, data[P].up5, n, 365, 250, nil, nil, 0x324650, 0x000000, 0, true)
  102. ui.addTextArea(14, data[P].up3, n, 290, 340, nil, nil, 0x324650, 0x000000, 0, true)
  103. ui.addTextArea(15, data[P].up7, n, 370, 160, nil, nil, 0x324650, 0x000000, 0, true)
  104. ui.addTextArea(3, "<a href='event:lmao'><font face='serif' color='#2b2b2b' size='12'><b>&#10005;</b></font></a>", n, 485, 59, 16, 16, 0x009D9D, 0x009D9D, 1, true)
  105. idle[n]=tfm.exec.addImage("15ab8fe3be0.png", "!999", 586, 100, n)--لفل
  106. idbar[n]=tfm.exec.addImage("15ab8fde446.png", "!999", 501, 227, n)--البار
  107. ui.addTextArea(17, "<b><p align='center'><BV>"..data[P].expp.." / <R>"..data[P].maxexp.."", n, 552, 235, 200, 20, 0x324650, 0x000000, 0, true)
  108. ui.addTextArea(18, "<font size='20'><p align='center'><b><J>"..data[P].level.."", n, 595, 135, 100, 100, 0x324650, 0x000000, 0, trueui.addTextArea(20,"<b><p align='center'>"..P.." "..text[n].points.." : "..data[P].points.."",n,200,360,360,22,0,0,0,true)
  109. idskill[n]=tfm.exec.addImage("15ab8fdb1e5.png", "&1", 290, 280, n)--الميب
  110. idskill2[n]=tfm.exec.addImage("15ab8fda007.png", "&1", 370, 190, n)--المفرقعات
  111. idskill3[n]=tfm.exec.addImage("15ab8fe17e6.png", "&1", 370, 280, n)--القفز
  112. idskill4[n]=tfm.exec.addImage("15ab8fe0697.png", "&1", 450, 190, n)--الطيران
  113. idskill5[n]=tfm.exec.addImage("15ab8fdd37a.png", "&1", 450, 280, n)--السرعة
  114. idskill6[n]=tfm.exec.addImage("15ab8fdc2be.png", "&1", 290, 190, n)--إزالة قلب
  115. idskill7[n]=tfm.exec.addImage("15ab8fdf5ae.png", "&1", 370, 100, n)--زيادة قلب
  116. if P==n then
  117. ui.addTextArea(6, data[P].skill2, n, 360, 320, nil, nil, 0x324650, 0x000000, 0, true)
  118. ui.addTextArea(7, data[P].skill3, n, 280, 320, nil, nil, 0x324650, 0x000000, 0, true)
  119. ui.addTextArea(8, data[P].skill1, n, 440, 320, nil, nil, 0x324650, 0x000000, 0, true)
  120. ui.addTextArea(9, data[P].skill6, n, 280, 230, nil, nil, 0x324650, 0x000000, 0, true)
  121. ui.addTextArea(10, data[P].skill5, n, 360, 230, nil, nil, 0x324650, 0x000000, 0, true)
  122. ui.addTextArea(16, data[P].skill7, n, 360, 140, nil, nil, 0x324650, 0x000000, 0, true)
  123. ui.addTextArea(0, data[P].skill4, n, 440, 230, nil, nil, 0x324650, 0x000000, 0, true)
  124. end
  125. end
  126.  
  127. function closeSkills(n)
  128. canSkills[n]=false
  129. for areas, k in pairs({"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"}) do
  130. ui.removeTextArea(k, n)
  131. end
  132. if idskill[n] then tfm.exec.removeImage(idskill[n]) idskill[n]=nil end
  133. if idskill2[n] then tfm.exec.removeImage(idskill2[n]) idskill2[n]=nil end
  134. if idskill3[n] then tfm.exec.removeImage(idskill3[n]) idskill3[n]=nil end
  135. if idskill4[n] then tfm.exec.removeImage(idskill4[n]) idskill4[n]=nil end
  136. if idskill5[n] then tfm.exec.removeImage(idskill5[n]) idskill5[n]=nil end
  137. if idskill6[n] then tfm.exec.removeImage(idskill6[n]) idskill6[n]=nil end
  138. if idskill7[n] then tfm.exec.removeImage(idskill7[n]) idskill7[n]=nil end
  139. if idle[n] then tfm.exec.removeImage(idle[n]) idle[n]=nil end
  140. if idbar[n] then tfm.exec.removeImage(idbar[n]) idbar[n]=nil end
  141. end
  142.  
  143. function eventMouse(n,x,y)
  144. if started and Warrirors(n) and data[n].point6 > 0 and canKill[n] then
  145. for k,v in pairs(tfm.get.room.playerList) do
  146. if (v.x < x+20 and v.x > x-20 and v.y > y-20 and v.y < y+20) then
  147. if k~=n and Warrirors(k) then
  148. tfm.exec.killPlayer(k)
  149. canKill[n]=false
  150. end end end end end
  151.  
  152. --Attack - Skills
  153. function eventKeyboard(n, k, d, x, y)
  154. if started then
  155. if k==2 then
  156. p[n].right=true
  157. p[n].left=true
  158. elseif k==0 then
  159. p[n].right=false
  160. p[n].left=false
  161. elseif k==32 and p[n].timestamp<os.time()-2000 and tfm.get.room.playerList[n].isDead==false and Warrirors(n) then
  162. p[n].objectid=tfm.exec.addShamanObject(35,x+(p[n].right and 15 or -15),y,0,p[n].right and 20 or -20)
  163. p[n].timestamp=os.time()
  164. table.insert(toDespawn,{os.time(),p[n].objectid})
  165. elseif k==75 and data[n].point1 > 0 and tfm.get.room.playerList[n].isDead==false and Warrirors(n) then
  166. data[n].counter=data[n].counter+1
  167. data[n].counter2=0
  168. data[n].counter3=0
  169. if data[n].counter==2 then
  170. tfm.exec.movePlayer(n,0,0,true,data[n].point1*50,0,false)
  171. data[n].counter=0
  172. end
  173. elseif k==72 and data[n].point1 > 0 and tfm.get.room.playerList[n].isDead==false and Warrirors(n) then
  174. data[n].counter2=data[n].counter2+1
  175. data[n].counter=0
  176. data[n].counter3=0
  177. if data[n].counter2==2 then
  178. tfm.exec.movePlayer(n,0,0,true,-data[n].point1*50,0,false)
  179. data[n].counter2=0
  180. end
  181. elseif k==85 and data[n].point2 > 0 and tfm.get.room.playerList[n].isDead==false and Warrirors(n) then
  182. data[n].counter3=data[n].counter3+1
  183. data[n].counter=0
  184. data[n].counter2=0
  185. if data[n].counter3==2 then
  186. tfm.exec.movePlayer(n,0,0,true,0,-data[n].point2*50,false)
  187. data[n].counter3=0
  188. end
  189. elseif k==74 and data[n].point5 > 0 and tfm.get.room.playerList[n].isDead==false and Warrirors(n) then
  190. if canSprite[n] and canSprite[n][1] == true then
  191. tfm.exec.displayParticle(12,x,y+30)
  192. tfm.exec.movePlayer(n,0,0,true,0,-75,false)
  193. elseif canSprite[n] == nil then
  194. canSprite[n] = {true, data[n].point5*20}
  195. tfm.exec.displayParticle(12,x,y+30)
  196. tfm.exec.movePlayer(n,0,0,true,0,-75,false)
  197. end
  198. elseif k==86 and tfm.get.room.playerList[n].isDead==false and data[n].point4 > 0 and Warrirors(n) then
  199. if canFly[n] and canFly[n][1] == true then
  200. tfm.exec.movePlayer(n,0,0,false,0,-40,false)
  201. elseif canFly[n] == nil then
  202. canFly[n] = {true, data[n].point4*20}
  203. tfm.exec.movePlayer(n,0,0,false,0,-40,false)
  204. end
  205. end
  206. end
  207. end
  208.  
  209. --eventNewPlayer - eventPlayerLeft - eventNewGame - eventPlayerDied - eventPlayerRespawn - eventPlayerWon
  210. function eventNewPlayer(n)
  211. tfm.exec.setPlayerScore(n,0)
  212. system.bindMouse(n,true)
  213. for keys, k in pairs({2,0,32,74,75,72,85,86}) do
  214. tfm.exec.bindKeyboard(n, k, true, true)
  215. end
  216. if Dataplayer(n) then else
  217. reData(n)
  218. table.insert(dataplayer,n)
  219. end
  220. setLang(n)
  221. table.insert(players,n)
  222. p[n]={timestamp=os.time(),imageid=0,objectid=0,right=false,left=false}
  223. mice=mice+1
  224. tfm.exec.respawnPlayer(n)
  225. if mice==4 then
  226. tfm.exec.setGameTime(5)
  227. end
  228. data[n].score=0
  229. tfm.exec.setPlayerScore(n,data[n].score,true)
  230. end
  231. table.foreach(tfm.get.room.playerList,eventNewPlayer)
  232.  
  233. function eventPlayerLeft(n)
  234. if Warrirors(n) then
  235. for index,p in pairs(warrirors) do
  236. tfm.exec.giveCheese(p)
  237. tfm.exec.playerVictory(p)
  238. end
  239. end
  240. players = {};
  241. for n,p in pairs (tfm.get.room.playerList) do
  242. table.insert(players, n)
  243. end
  244. mice=mice-1
  245. if mice==3 then
  246. tfm.exec.setGameTime(5)
  247. end
  248. end
  249.  
  250. function eventNewGame()
  251. warrirors={}
  252. canFly={}
  253. canSprite={}
  254. started=false
  255. for n,p in pairs(tfm.get.room.playerList) do
  256. canKill[n]=true
  257. tfm.exec.respawnPlayer(n)
  258. if idre[n] then tfm.exec.removeImage(idre[n],n) idre[n]=nil end
  259. ui.removeTextArea(21,n)
  260. if idheart1[n] then tfm.exec.removeImage(idheart1[n],n) idheart1[n]=nil end
  261. if idheart2[n] then tfm.exec.removeImage(idheart2[n],n) idheart2[n]=nil end
  262. if idheart3[n] then tfm.exec.removeImage(idheart3[n],n) idheart3[n]=nil end
  263. if idheart4[n] then tfm.exec.removeImage(idheart4[n],n) idheart4[n]=nil end
  264. if idheart5[n] then tfm.exec.removeImage(idheart5[n],n) idheart5[n]=nil end
  265. if idheart6[n] then tfm.exec.removeImage(idheart6[n],n) idheart6[n]=nil end
  266. data[n].heart=5
  267. if data[n].point7 > 0 then
  268. data[n].heart=6
  269. end
  270. end
  271. if 4 <= mice then
  272. tfm.exec.setGameTime(180)
  273. repeat
  274. warrirors[1] = players[math.random(#players)]
  275. warrirors[2] = players[math.random(#players)]
  276. until warrirors[2] ~= warrirors[1]
  277. for n,p in pairs(tfm.get.room.playerList) do
  278. tfm.exec.chatMessage(""..text[n].fight.." "..warrirors[1].." & "..warrirors[2].."",n)
  279. if data[n].point3 > 0 and Warrirors(n) then
  280. tfm.exec.giveMeep(n)
  281. end
  282. data[n].counter=0
  283. data[n].counter2=0
  284. data[n].counter3=0
  285. if Warrirors(n) then
  286. idheart1[n] = tfm.exec.addImage("1593c276aa5.png", "&1", 679, 26, n)
  287. idheart2[n] = tfm.exec.addImage("1593c276aa5.png", "&1", 704, 26, n)
  288. idheart3[n] = tfm.exec.addImage("1593c276aa5.png", "&1", 729, 26, n)
  289. idheart4[n] = tfm.exec.addImage("1593c276aa5.png", "&1", 754, 26, n)
  290. idheart5[n] = tfm.exec.addImage("1593c276aa5.png", "&1", 779, 26, n)
  291. if data[n].point7 > 0 then
  292. idheart6[n] = tfm.exec.addImage("1593c276aa5.png", "&1", 654, 26, n)
  293. end
  294. end
  295. end
  296. end
  297. for i,v in pairs(maps) do
  298. if v.code == tfm.get.room.currentMap then
  299. for index,p in pairs(warrirors) do
  300. tfm.exec.movePlayer(p, v.x, v.y)
  301. tfm.exec.respawnPlayer(p)
  302. end
  303. end
  304. end
  305. end
  306.  
  307. function eventPlayerRespawn(n)
  308. if data[n].point3 > 0 and Warrirors(n) then
  309. tfm.exec.giveMeep(n)
  310. end
  311. end
  312.  
  313. function eventPlayerWon(n)
  314. tfm.exec.setGameTime(5)
  315. tfm.exec.chatMessage(text[n].won,n)
  316. data[n].expp=data[n].expp+5
  317. if data[n].expp==data[n].maxexp then
  318. data[n].expp=0
  319. data[n].level=data[n].level+1
  320. data[n].points=data[n].points+1
  321. data[n].maxexp=data[n].maxexp+10
  322. end
  323. for k,p in pairs(tfm.get.room.playerList) do tfm.exec.chatMessage(""..n.." "..text[k].winner.."",k) end
  324. data[n].score=10
  325. tfm.exec.setPlayerScore(n,data[n].score,true)
  326. end
  327.  
  328. function eventPlayerDied(n)
  329. data[n].retime=5
  330. data[n].counter=0
  331. data[n].counter2=0
  332. data[n].counter3=0
  333. for i,v in pairs(maps) do
  334. if v.code == tfm.get.room.currentMap then
  335. if Warrirors(n) and 1 <= data[n].heart and started==true then
  336. data[n].heart=data[n].heart-1
  337. if idre[n] then tfm.exec.removeImage(idre[n],n) idre[n]=nil end
  338. ui.removeTextArea(21,n)
  339. idre[n] = tfm.exec.addImage("15ab8fe2966.png", "&1", v.x-31.5, v.y-65, n)
  340. ui.addTextArea(21, "<p align='center'><b>"..text[n].respawn.."", n, v.x-68.5, v.y-85, 166, 23, 0x24650, 0x324650, 1, true)
  341. elseif n~="warrirors" and 1 <= data[n].heart and started==true then
  342. X=tfm.get.room.playerList[n].x
  343. Y=tfm.get.room.playerList[n].y
  344. if idre[n] then tfm.exec.removeImage(idre[n],n) idre[n]=nil end
  345. ui.removeTextArea(21,n)
  346. idre[n] = tfm.exec.addImage("15ab8fe2966.png", "&1", X-31.5, Y-65, n)
  347. ui.addTextArea(21, "<p align='center'><b>"..text[n].respawn.."", n, X-68.5, Y-85, 166, 23, 0x24650, 0x324650, 1, true)
  348. end
  349. end
  350. end
  351. if data[n].heart <= 0 then end
  352. end
  353.  
  354.  
  355. --TextAreaCallback
  356. function eventTextAreaCallback(ids,n,c)
  357. if c=="up" and data[n].point1 < 3 and data[n].points > 0 then
  358. data[n].point1=data[n].point1+1
  359. data[n].points=data[n].points-1
  360. if data[n].point1==1 then data[n].up1="<p align='center'><b>[<VP>•<R>••<N>]" elseif data[n].point1==2 then data[n].up1="<p align='center'><b>[<VP>••<R>•<N>]" elseif data[n].point1==3 then data[n].up1="<p align='center'><b>[<VP>•••<N>]" data[n].skill1="<p align='center'><b>"..text[n].full.."" end
  361. closeSkills(n)
  362. Skills(n,n)
  363. data[n].tier1=data[n].tier1+1
  364. elseif c=="up2" and data[n].point2 < 3 and data[n].points > 0 then
  365. data[n].point2=data[n].point2+1
  366. if data[n].point2==1 then data[n].up2="<p align='center'><b>[<VP>•<R>••<N>]" elseif data[n].point2==2 then data[n].up2="<p align='center'><b>[<VP>••<R>•<N>]" elseif data[n].point2==3 then data[n].up2="<p align='center'><b>[<VP>•••<N>]" data[n].skill2="<p align='center'><b>"..text[n].full.."" end
  367. closeSkills(n)
  368. Skills(n,n)
  369. data[n].tier1=data[n].tier1+1
  370. elseif c=="up3" and data[n].point3 < 1 and data[n].points > 0 then
  371. data[n].point3=data[n].point3+1
  372. data[n].points=data[n].points-1
  373. data[n].up3="<p align='center'><b>[<VP>•<N>]"
  374. data[n].skill3="<p align='center'><b>"..text[n].full..""
  375. if Warrirors(n) then
  376. tfm.exec.giveMeep(n)
  377. end
  378. closeSkills(n)
  379. Skills(n,n)
  380. data[n].tier1=data[n].tier1+1
  381. elseif c=="up4" and data[n].point4 < 3 and data[n].points > 0 and data[n].tier1 >= 5 then
  382. data[n].point4=data[n].point4+1
  383. data[n].points=data[n].points-1
  384. if data[n].point4==1 then data[n].up4="<p align='center'><b>[<VP>•<R>••<N>]" elseif data[n].point4==2 then data[n].up4="<p align='center'><b>[<VP>••<R>•<N>]" elseif data[n].point4==3 then data[n].up4="<p align='center'><b>[<VP>•••<N>]" data[n].skill4="<p align='center'><b>"..text[n].full.."" end
  385. closeSkills(n)
  386. Skills(n,n)
  387. data[n].tier2=data[n].tier2+1
  388. elseif c=="up5" and data[n].point5 < 3 and data[n].points > 0 and data[n].tier1 >= 5 then
  389. data[n].point5=data[n].point5+1 if data[n].point5==1 then data[n].up5="<p align='center'><b>[<VP>•<R>••<N>]" elseif data[n].point5==2 then data[n].up5="<p align='center'><b>[<VP>••<R>•<N>]" elseif data[n].point5==3 then data[n].up5="<p align='center'><b>[<VP>•••<N>]" data[n].skill5="<p align='center'><b>"..text[n].full.."" end
  390. data[n].points=data[n].points-1
  391. closeSkills(n)
  392. Skills(n,n)
  393. data[n].tier2=data[n].tier2+1
  394. elseif c=="up6" and data[n].point6 < 1 and data[n].points > 0 and data[n].tier1 >= 5 then
  395. data[n].point6=data[n].point6+1
  396. data[n].up6="<p align='center'><b>[<VP>•<N>]"
  397. data[n].skill6="<p align='center'><b>"..text[n].full..""
  398. data[n].points=data[n].points-1
  399. closeSkills(n)
  400. Skills(n,n)
  401. data[n].tier2=data[n].tier2+1
  402. elseif c=="up7" and data[n].point7 < 1 and data[n].points > 0 and data[n].tier2 >= 5 then
  403. data[n].point7=data[n].point7+1
  404. data[n].up7="<p align='center'><b>[<VP>•<N>]"
  405. data[n].skill7="<p align='center'><b>"..text[n].full..""
  406. data[n].points=data[n].points-1
  407. closeSkills(n)
  408. Skills(n,n)
  409. elseif c=="lmao" then
  410. closeSkills(n)
  411. end
  412. end
  413.  
  414. --Loops!!!
  415. function eventLoop(time,remaining)
  416. if remaining <= 0 then
  417. if 4 <= mice then
  418. newMap()
  419. elseif mice <= 3 then
  420. tfm.exec.newGame("@6984945")
  421. end
  422. end
  423. if mice <= 3 then
  424. for n,p in pairs(tfm.get.room.playerList) do
  425. if canSkills[n] then
  426. else
  427. ui.addTextArea(22, "<p align='center'><font size='50'><b><R>"..text[n].waiting.."<br>"..mice.." / 4", n, 120, 130, 560, 139, 0x324650, 0x000000, 0, true)
  428. end
  429. end
  430. else
  431. ui.removeTextArea(22,nil)
  432. end
  433. for n,p in pairs(tfm.get.room.playerList) do
  434. if canSkills[n] then
  435. ui.addTextArea(20,"<b><p align='center'>"..data[n].player.." "..text[n].points.." : "..data[data[n].player].points.."",n,200,360,360,22,0,0,0,true)
  436. end
  437. data[n].retime=data[n].retime-1
  438. Hearts(n)
  439. if data[n].retime==0 and started==true then
  440. tfm.exec.respawnPlayer(n)
  441. if idre[n] then tfm.exec.removeImage(idre[n],n) idre[n]=nil end
  442. ui.removeTextArea(21,n)
  443. if Warrirors(n) then
  444. for i,v in pairs(maps) do
  445. if v.code == tfm.get.room.currentMap then
  446. tfm.exec.movePlayer(n, v.x, v.y)
  447. if idre[n] then tfm.exec.removeImage(idre[n],n) idre[n]=nil end
  448. ui.removeTextArea(21,n)
  449. end
  450. end
  451. else
  452. tfm.exec.movePlayer(n,X,Y)
  453. end
  454. end
  455. end
  456. if time >= 3000 and not started then
  457. started=true
  458. end
  459. for n in pairs(tfm.get.room.playerList) do
  460. for i,cannon in ipairs(toDespawn) do
  461. if cannon[1] <= os.time()-1500 then
  462. tfm.exec.removeObject(cannon[2])
  463. table.remove(toDespawn,i)
  464. end
  465. end
  466. end
  467. for i in pairs(canFly) do
  468. canFly[i][2] = canFly[i][2] - 1
  469. if canFly[i][2] <= 0 then
  470. canFly[i][1] = false
  471. end
  472. end
  473. for i in pairs(canSprite) do
  474. canSprite[i][2] = canSprite[i][2] - 1
  475. if canSprite[i][2] <= 0 then
  476. canSprite[i][1] = false
  477. end
  478. end
  479. end
  480.  
  481. --Chat Commands
  482. local c={"skills","c"}
  483. function eventChatCommand(n,cmd)
  484. local c={}
  485. for i in cmd:gmatch('[^%s]+') do table.insert(c,i) end
  486. c[1]=c[1]:lower()
  487. if cmd:sub(0,6)=="skills" and Dataplayer(cmd:sub(8)) then
  488. closeSkills(n)
  489. P = cmd:sub(8,8):upper()..cmd:sub(9):lower()
  490. Skills(P,n)
  491. elseif cmd:lower()=="skills" then
  492. closeSkills(n) Skills(n,n)
  493. elseif c[1]=="np" and n=="Bodykudo" then
  494. newMap()
  495. elseif c[1]=="c" and Warrirors(n) then
  496. for index,p in pairs(warrirors) do
  497. if p==n then
  498. tfm.exec.chatMessage("<V>["..n.."] : <N>"..c[2].."",p)
  499. elseif p~=n then
  500. tfm.exec.chatMessage("<CH><["..n.."] : <N>"..c[2].."",p)
  501. end end
  502. end
  503. end
  504. for i=1,#c do system.disableChatCommandDisplay(c[i],true) end
  505.  
  506. if 4 <= mice then
  507. newMap()
  508. elseif mice <= 3 then
  509. tfm.exec.newGame("@6984945")
  510. for n,p in pairs(tfm.get.room.playerList) do
  511. ui.addTextArea(22, "<p align='center'><font size='50'><b><R>"..text[n].waiting.."<br>"..mice.." / 4", n, 120, 130, 560, 139, 0x324650, 0x000000, 0, true)
  512. end
  513. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement