Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.98 KB | None | 0 0
  1. -- luaMagic SCRIPT v.1.0.0
  2. -- Author: Boxofkrain#0000 | Last edit: 12.01.2019
  3. -- Atelier801 forum thread:
  4.  
  5. -- WARTOŚCI DO EDYCJI
  6. rainbowColors = {"FF0000", "00FF00", "FFFF00", "2222FF", "FF00FF"} -- Kolory RGB użyte w funckji "Tęcza"
  7. blackScreenColor = "111111" -- Dokładny kolor RGB czarnego ekranu w funkcji "Czarny ekran"
  8. whiteScreenColor = "FFFFFF" -- Dokładny kolor RGB białego ekranu w funkcji "Biały ekran"
  9. snowTime = 60 -- Czas padania śniegu w sekundach w fukcji "Śnieg"
  10.  
  11. flyPower = 55 -- Moc wypchnięcia w górę w funkcji "Latanie"
  12. speedNmPower = 70 -- Siła wypchnięcia na boki w funckji "Prędkość NM"
  13. autoSpeedPower = 90 -- Siła wypchnięcia na boki w funkcji "AutoPrędkość"
  14. explosionsPower = 15 -- Siła eksplozji w funkcji "Eksplozje"
  15. explosionsRange = 60 -- Zasięg eksplozji w funkcji "Eksplozje"
  16. explosionsMarginX = 40 -- Margines losowości miejsca wybuchów w osi X w funkcji "Eksplozje"
  17. explosionsMarginY = 40 -- Margines losowości miejsca wybuchów w osi Y w funkcji "Eksplozje"
  18. minGravityPower = 50 -- Siła ujemnej grawitacji w funkcji "- Grawitacja"
  19.  
  20. controlKeys = {85, 72, 74, 75} -- ID klawiszy sterowania w funkcji "Sterowanie" (U, J, H, K)
  21. speedKeys = {77, 78} -- ID klawiszy prędkości w fukcji "Prędkość NM" (M, N)
  22.  
  23. uiStartCom = "UI" -- Komenda otwierająca menu
  24. uiMenuColor = "222222" -- Kolor RGB menu
  25. uiMenuBorderColor = "222222" -- Kolor RGB ramki menu
  26. uiFontColor = "DBDBDB" -- Kolor RGB czcionki menu
  27. uiMenuTransparency = 0.7 -- Przezroczystość menu (alfa)
  28. messageWindowTime = 2200 -- Czas pokazywania okienka informacyjnego w milisekundach
  29. -----------
  30.  
  31. -- VARIABLES
  32. menuTextVisual = "<font color='#" .. uiFontColor .. "'><font size='14'>Wizualne:</font>\n\n<a href='event:nameColor'>Kolor nazwy</a>\n<a href='event:rainbow'>Tęcza</a>\n<a href='event:blackScreen'>Czarny ekran</a>\n<a href='event:whiteScreen'>Biały ekran</a>\n<a href='event:particles'>Cząsteczki</a>\n<a href='event:snow'>Śnieg</a>\n<a href='event:mapName'>Nazwa mapy</a>\n<a href='event:shamanName'>Nazwa szamana</a>\n\n<p align='center'><a href='event:hideVisualMenu'>↑ Schowaj ↑</a></p>"
  33. menuTextMovement = "<font color='#" .. uiFontColor .. "'><font size='14'>Ruch:</font>\n\n<a href='event:fly'>Latanie</a>\n<a href='event:teleport'>Teleport</a>\n<a href='event:speedNM'>Prędkość (NM)</a>\n<a href='event:autoSpeed'>AutoPrędkość</a>\n<a href='event:lockMove'>Blokada ruchu</a>\n<a href='event:control'>Sterowanie</a>\n<a href='event:autoExplosions'>Eksplozje</a>\n<a href='event:minGravity'>- Grawitacja</a>\n\n<p align='center'><a href='event:hideMovementMenu'>↑ Schowaj ↑</a></p>"
  34. menuTextPlayer = "<font color='#" .. uiFontColor .. "'><font size='14'>Gracz:</font>\n\n<a href='event:giveCheese'>Serek</a>\n<a href='event:autowin'>Wygrana</a>\n<a href='event:ice'>Zamrożenie</a>\n<a href='event:shaman'>Szaman</a>\n<a href='event:respawn'>Ożywienie</a>\n<a href='event:disappear'>Zniknięcie</a>\n<a href='event:playEmote'>Czynność</a>\n<a href='event:cage'>Klatka</a>\n\n<p align='center'><a href='event:hidePlayerMenu'>↑ Schowaj ↑</a></p>"
  35. menuTextObjects = "<font color='#" .. uiFontColor .. "'><font size='14'>Obiekty:</font>\n\n<a href='event:newObject'>Nowy obiekt</a>\n<a href='event:newGround'>Nowy grunt</a>\n<a href='event:removeObject'>Usuń obiekt</a>\n<a href='event:removeGround'>Usuń grunt</a>\n\n\n\n\n\n<p align='center'><a href='event:hideObjectMenu'>↑ Schowaj ↑</a></p>"
  36.  
  37. scriptVersion = "1.0.0"
  38.  
  39. i = 1
  40. disappearPlayers = {}
  41. groundParameters1 = {type=10, width=15, height=60}
  42. groundParameters2 = {type=10, width=60, height=15}
  43.  
  44. -- FUNCTIONS
  45. function showUi(menuNumber)
  46. if (menuNumber==0) then ui.addTextArea(0, menuTextVisual, adm, 5, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  47. elseif (menuNumber==1) then ui.addTextArea(1, menuTextMovement, adm, 120, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  48. elseif (menuNumber==2) then ui.addTextArea(2, menuTextPlayer, adm, 235, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  49. elseif (menuNumber==3) then ui.addTextArea(3, menuTextObjects, adm, 350, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  50. elseif (menuNumber==nil) then
  51. ui.addTextArea(0, menuTextVisual, adm, 5, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  52. ui.addTextArea(1, menuTextMovement, adm, 120, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  53. ui.addTextArea(2, menuTextPlayer, adm, 235, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  54. ui.addTextArea(3, menuTextObjects, adm, 350, 25, 100, 170, "0x" .. uiMenuColor, "0x" .. uiMenuBorderColor, uiMenuTransparency, true)
  55. end
  56. end
  57.  
  58. function showMessage(text, err)
  59. if (err==true) then ui.addTextArea(5, "<R>" .. text .. "</R>", adm, 550, 365, 250, 35, 0x222222, 0x222222, 0.7, true)
  60. else ui.addTextArea(5, "<font color='#00cc00'>" .. text .. "</font>", adm, 550, 365, 250, 35, 0x222222, 0x222222, 0.7, true) end
  61. messageWindowActive = true
  62. end
  63.  
  64. function bindKeys(keysArr, player)
  65. if (player=="*") then
  66. for n in next, tfm.get.room.playerList do
  67. for _,v in pairs(keysArr) do system.bindKeyboard(n, v, true) end
  68. end
  69. else for _,v in pairs(keysArr) do system.bindKeyboard(player, v, true) end end
  70. end
  71.  
  72. function playerExists(player, pSelect)
  73. for n in next, tfm.get.room.playerList do
  74. if (pSelect==true and player=="*" or pSelect==true and player=="") then return true
  75. elseif (n==player) then
  76. return true
  77. end
  78. end
  79. return false
  80. end
  81. ------------
  82.  
  83. function eventChatCommand(n,c)
  84. if (c:upper()==uiStartCom and adm==nil or c:upper()==uiStartCom and adm==n) then adm=n showUi() end
  85. end
  86.  
  87. function eventTextAreaCallback(id, n, ev)
  88. if (adm==n and id==0) then
  89. if (ev=="nameColor") then ui.addPopup(1, 2, "[KOLOR NAZWY]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  90. elseif (ev=="rainbow") then
  91. if (actRainbow==nil) then ui.addPopup(2, 2, "[TĘCZA]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  92. else actRainbow = nil ui.removeTextArea(4) showMessage("Tęcza wyłączona", true) end
  93. elseif (ev=="blackScreen") then
  94. if (blackScreen==nil) then ui.addPopup(3, 2, "[BLACKSCREEN]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  95. else blackScreen = nil ui.removeTextArea(4) showMessage("Czarny ekran wyłączony", true) end
  96. elseif (ev=="whiteScreen") then
  97. if (whiteScreen==nil) then ui.addPopup(4, 2, "[WHITESCREEN]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  98. else whiteScreen = nil ui.removeTextArea(4) showMessage("Biały ekran wyłączony", true) end
  99. elseif (ev=="particles") then
  100. if (actParticles==nil) then ui.addPopup(5, 2, "[CZĄSTECZKI]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  101. else actParticles = nil showMessage("Cząsteczki wyłączone", true) end
  102. elseif (ev=="snow") then tfm.exec.snow(snowTime) showMessage("Śnieg aktywowany")
  103. elseif (ev=="mapName") then ui.addPopup(6, 2, "[NAZWA_MAPY]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  104. elseif (ev=="shamanName") then ui.addPopup(7, 2, "[NAZWA_SZAMANA]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  105. elseif (ev=="hideVisualMenu") then ui.addTextArea(0, "<p align='center'><a href='event:showVisualMenu'>↓ Wizualne ↓</a></p>", adm, 5, 25, 100, 20, 0x222222, 0x222222, 0.7, true)
  106. elseif (ev=="showVisualMenu") then showUi(0) end
  107. elseif (adm==n and id==1) then
  108. if (ev=="autoSpeed") then
  109. if (actAutoSpeed==nil) then ui.addPopup(8, 2, "[AUTO_PRĘDKOŚĆ]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  110. else actAutoSpeed = nil showMessage("AutoPrędkość wyłączona", true) end
  111. elseif (ev=="fly") then
  112. if (actFly==nil) then ui.addPopup(9, 2, "[LATANIE]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  113. else actFly = nil showMessage("Latanie wyłączone", true) end
  114. elseif (ev=="teleport") then
  115. if (actTp==nil) then ui.addPopup(10, 2, "[TELEPORT]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  116. else actTp = nil showMessage("Teleport wyłączony", true) end
  117. elseif (ev=="speedNM") then
  118. if (actSpeedNM==nil) then ui.addPopup(11, 2, "[PRĘDKOŚĆ_NM]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  119. else actSpeedNM = nil showMessage("Prędkość NM wyłączona", true) end
  120. elseif (ev=="lockMove") then
  121. if (actLockMove==nil) then ui.addPopup(12, 2, "[ZABLOKUJ_RUCH]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  122. else actLockMove = nil showMessage("Blokada ruchu wyłączona", true) end
  123. elseif (ev=="control") then
  124. if (actControl==nil) then ui.addPopup(13, 2, "[ZDALNE_STEROWANIE]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  125. else actControl = nil showMessage("Zdalne sterowanie wyłączone", true) end
  126. elseif (ev=="autoExplosions") then
  127. if (actAutoExplosions==nil) then ui.addPopup(15, 2, "[EKSPLOZJE]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  128. else actAutoExplosions = nil showMessage("Eksplozje wyłączone", true) end
  129. elseif (ev=="minGravity") then
  130. if (actMinGravity==nil) then ui.addPopup(22, 2, "[-GRAWITACJA]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  131. else actMinGravity = nil showMessage("- Grawitacja wyłączona", true) end
  132. elseif (ev=="hideMovementMenu") then ui.addTextArea(1, "<p align='center'><a href='event:showMovementMenu'>↓ Ruch ↓</a></p>", adm, 120, 25, 100, 20, 0x222222, 0x222222, 0.7, true)
  133. elseif (ev=="showMovementMenu") then showUi(1) end
  134. elseif (adm==n and id==2) then
  135. if (ev=="giveCheese") then ui.addPopup(16, 2, "[SEREK]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  136. elseif (ev=="autowin") then ui.addPopup(17, 2, "[WYGRANA]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  137. elseif (ev=="ice") then ui.addPopup(18, 2, "[ZAMROŻENIE]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  138. elseif (ev=="shaman") then ui.addPopup(19, 2, "[SZAMAN]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  139. elseif (ev=="respawn") then ui.addPopup(20, 2, "[OŻYWIENIE]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  140. elseif (ev=="cage") then
  141. if (actCage==nil) then ui.addPopup(21, 2, "[KLATKA]\nNazwa gracza", adm, 270, 150, 250, true)
  142. else actCage=nil for i=0,3 do tfm.exec.removePhysicObject(i) end showMessage("Klatka wyłączona", true)
  143. end
  144. elseif (ev=="disappear") then
  145. if (actDisappear==nil) then ui.addPopup(23, 2, "[ZNIKNIĘCIE]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  146. else
  147. actDisappear = nil
  148. if (disappearTarget~="*") then tfm.exec.killPlayer(disappearTarget) tfm.exec.respawnPlayer(disappearTarget)
  149. else for n in next, tfm.get.room.playerList do tfm.exec.killPlayer(n) tfm.exec.respawnPlayer(n) end end
  150. showMessage("Zniknięcie wyłączone", true)
  151. end
  152. elseif (ev=="playEmote") then ui.addPopup(24, 2, "[CZYNNOŚĆ]\nNazwa gracza / Wszyscy = *", adm, 270, 150, 250, true)
  153. elseif (ev=="hidePlayerMenu") then ui.addTextArea(2, "<p align='center'><a href='event:showPlayerMenu'>↓ Gracz ↓</a></p>", adm, 235, 25, 100, 20, 0x222222, 0x222222, 0.7, true)
  154. elseif (ev=="showPlayerMenu") then showUi(2) end
  155. elseif (adm==n and id==3) then
  156. if (ev=="newObject") then
  157. if (actObject==nil) then ui.addPopup(26, 2, "[OBIEKT]\nNumer obiektu", adm, 270, 150, 250, true)
  158. else actObject = nil showMessage("Spawn obiektów wyłączony", true) end
  159. elseif (ev=="hideObjectMenu") then ui.addTextArea(3, "<p align='center'><a href='event:showObjectMenu'>↓ Obiekty ↓</a></p>", adm, 350, 25, 100, 20, 0x222222, 0x222222, 0.7, true)
  160. elseif (ev=="showObjectMenu") then showUi(3) end
  161. end
  162.  
  163. end
  164.  
  165. function eventPopupAnswer(id, n, reply)
  166. if (adm==n) then
  167. if (id==1) then
  168. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  169. elseif (reply~="") then
  170. nameColorTarget = reply
  171. ui.showColorPicker(2, adm, nil, "Kolor nazwy")
  172. end
  173. elseif (id==2) then
  174. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  175. elseif (reply~="") then
  176. rainbowTarget = reply
  177. actRainbow = true
  178. if (reply=="*") then showMessage("Tęcza aktywowana dla wszystkich graczy")
  179. else showMessage("Tęcza aktywowana dla gracza " .. reply) end
  180. end
  181. elseif (id==3) then
  182. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  183. elseif (reply~="") then
  184. blackScreen = true
  185. if (reply=="*") then
  186. for n in next, tfm.get.room.playerList do ui.addTextArea(4, "", n, -400, -200, 1600, 1200, "0x" .. blackScreenColor) end
  187. else ui.addTextArea(4, "", reply, -400, -200, 1600, 1200, "0x" .. blackScreenColor) end
  188. if (reply=="*") then showMessage("Czarny ekran aktywowany dla wszystkich graczy")
  189. else showMessage("Czarny ekran aktywowany dla gracza " .. reply) end
  190. end
  191. elseif (id==4) then
  192. if (not(playerExists(reply, true))) then playerError(reply)
  193. elseif (reply~="") then
  194. whiteScreen = true
  195. if (reply=="*") then
  196. for n in next, tfm.get.room.playerList do ui.addTextArea(4, "", n, -400, -200, 1600, 1200, "0x" .. whiteScreenColor) end
  197. else ui.addTextArea(4, "", reply, -400, -200, 1600, 1200, "0x" .. whiteScreenColor) end
  198. if (reply=="*") then showMessage("Biały ekran aktywowany dla wszystkich graczy")
  199. else showMessage("Biały ekran aktywowany dla gracza " .. reply) end
  200. end
  201. elseif (id==5) then
  202. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  203. elseif (reply~="") then
  204. actParticles = true
  205. particlesTarget = reply
  206. if (reply=="*") then showMessage("Cząsteczki aktywowane dla wszystkich graczy")
  207. else showMessage("Cząsteczki aktywowane dla gracza " .. reply) end
  208. end
  209. elseif (id==6) then
  210. ui.setMapName(reply)
  211. showMessage("Nazwa mapy zmieniona na " .. reply)
  212. elseif (id==7) then
  213. ui.setShamanName(reply)
  214. showMessage("Nazwa szamana zmieniona na " .. reply)
  215. elseif (id==8) then
  216. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  217. elseif (reply~="") then
  218. autoSpeedTarget = reply
  219. actAutoSpeed = true
  220. if (reply=="*") then showMessage("AutoPrędkość aktywowana dla wszystkich graczy")
  221. else showMessage("AutoPrędkość aktywowana dla gracza " .. reply) end
  222. end
  223. elseif (id==9) then
  224. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  225. elseif (reply~="") then
  226. actFly = true
  227. flyTarget = reply
  228. if (reply=="*") then bindKeys({32}, "*") showMessage("Latanie aktywowane dla wszystkich graczy")
  229. else bindKeys({32}, reply) showMessage("Latanie aktywowane dla gracza " .. reply) end
  230. end
  231. elseif (id==10) then
  232. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  233. elseif (reply~="") then
  234. actTp = true
  235. tpTarget = reply
  236. if (reply=="*") then
  237. for n in next, tfm.get.room.playerList do system.bindMouse(n, true) end
  238. showMessage("Teleport aktywowany dla wszystkich graczy")
  239. else
  240. system.bindMouse(reply, true)
  241. showMessage("Teleport aktywowany dla gracza " .. reply)
  242. end
  243. end
  244. elseif (id==11) then
  245. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  246. elseif (reply~="") then
  247. actSpeedNM = true
  248. speedNMTarget = reply
  249. bindKeys(speedKeys, speedNMTarget)
  250. if (reply=="*") then showMessage("Prędkość NM aktywowana dla wszystkich graczy")
  251. else showMessage("Prędkość NM aktywowana dla gracza " .. reply) end
  252. end
  253. elseif (id==12) then
  254. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  255. elseif (reply~="") then
  256. actLockMove = true
  257. lockMoveTarget = reply
  258. if (reply=="*") then showMessage("Blokada ruchu aktywowana dla wszystkich graczy")
  259. else showMessage("Blokada ruchu aktywowana dla gracza " .. reply) end
  260. end
  261. elseif (id==13) then
  262. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  263. elseif (reply~="") then
  264. ui.addPopup(14, 2, "[ZDALNE_STEROWANIE]\nSiła", adm, 270, 150, 250, true)
  265. actControl = true
  266. controlTarget = reply
  267. end
  268. elseif (id==14) then
  269. controlPower=reply
  270. bindKeys(controlKeys, adm)
  271. if (controlTagret=="*") then showMessage("Sterowanie aktywowane dla wszystkich graczy (siła: " .. reply .. ")")
  272. else showMessage("Sterowanie aktywowane dla gracza " .. reply .. " (siła: " .. controlPower ..")") end
  273. elseif (id==15) then
  274. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  275. elseif (reply~="") then
  276. autoExplosionsTarget = reply
  277. actAutoExplosions = true
  278. if (reply=="*") then showMessage("Eksplozje aktywowane dla wszystkich graczy")
  279. else showMessage("Eksplozje aktywowane dla gracza " .. reply) end
  280. end
  281. elseif (id==16) then
  282. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  283. elseif (reply~="") then
  284. if (reply~="*") then
  285. tfm.exec.giveCheese(reply)
  286. showMessage("Serek wręczony graczowi " .. reply)
  287. else
  288. for n in next, tfm.get.room.playerList do tfm.exec.giveCheese(n) end
  289. showMessage("Serek wręczony wszystkim graczom")
  290. end
  291. end
  292. elseif (id==17) then
  293. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  294. elseif (reply~="") then
  295. if (reply~="*") then
  296. tfm.exec.giveCheese(reply)
  297. tfm.exec.playerVictory(reply)
  298. showMessage("Wygrana wręczona graczowi " .. reply)
  299. else
  300. for n in next, tfm.get.room.playerList do
  301. tfm.exec.giveCheese(n)
  302. tfm.exec.playerVictory(n)
  303. end
  304. showMessage("Wygrana wręczona wszystkim graczom")
  305. end
  306. end
  307. elseif (id==18) then
  308. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  309. elseif (reply~="") then
  310. if (reply~="*") then
  311. currentFreezeX = tfm.get.room.playerList[reply].x
  312. currentFreezeY = tfm.get.room.playerList[reply].y
  313. tfm.exec.addShamanObject(54, currentFreezeX, currentFreezeY)
  314. tfm.exec.killPlayer(reply)
  315. showMessage("Zamrożono gracza " .. reply)
  316. else
  317. currentFreezeX = {}
  318. currentFreezeY = {}
  319. for n in next, tfm.get.room.playerList do
  320. currentFreezeX[n] = tfm.get.room.playerList[n].x
  321. currentFreezeY[n] = tfm.get.room.playerList[n].y
  322. tfm.exec.addShamanObject(54, currentFreezeX[n], currentFreezeY[n])
  323. tfm.exec.killPlayer(n)
  324. end
  325. showMessage("Zamrożono wszystkich graczy")
  326. end
  327. end
  328. elseif (id==19) then
  329. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  330. elseif (reply~="") then
  331. if (reply~="*") then
  332. tfm.exec.setShaman(reply)
  333. showMessage("Szaman wręczony graczowi " .. reply)
  334. else
  335. for n in next, tfm.get.room.playerList do tfm.exec.setShaman(n) end
  336. showMessage("Szaman wręczony wszystkim graczom")
  337. end
  338. end
  339. elseif (id==20) then
  340. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  341. elseif (reply~="") then
  342. if (reply~="*") then
  343. tfm.exec.respawnPlayer(reply)
  344. showMessage("Ożywiono gracza " .. reply)
  345. else
  346. for n in next, tfm.get.room.playerList do tfm.exec.respawnPlayer(n) end
  347. showMessage("Ożywiono wszystkich graczy")
  348. end
  349. end
  350. elseif (id==21) then
  351. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  352. elseif (reply~="" and reply~="*") then
  353. actCage = true
  354. currentCageX = tfm.get.room.playerList[reply].x
  355. currentCageY = tfm.get.room.playerList[reply].y
  356. tfm.exec.addPhysicObject(0, currentCageX-25, currentCageY, groundParameters1)
  357. tfm.exec.addPhysicObject(1, currentCageX, currentCageY-25, groundParameters2)
  358. tfm.exec.addPhysicObject(2, currentCageX+25, currentCageY, groundParameters1)
  359. tfm.exec.addPhysicObject(3, currentCageX, currentCageY+25, groundParameters2)
  360. showMessage("Klatka aktywowana dla gracza " .. reply)
  361. end
  362. elseif (id==22) then
  363. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  364. elseif (reply~="") then
  365. actMinGravity = true
  366. minGravityTarget = reply
  367. if (reply=="*") then showMessage("- Grawitacja aktywowana dla wszystkich graczy")
  368. else showMessage("- Grawitacja aktywowana dla gracza " .. reply) end
  369. end
  370. elseif (id==23) then
  371. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  372. elseif (reply~="") then
  373. actDisappear = true
  374. disappearTarget = reply
  375. if (reply=="*") then showMessage("Zniknięcie aktywowane dla wszystkich graczy")
  376. else showMessage("Zniknięcie aktywowane dla gracza " .. reply) end
  377. end
  378. elseif (id==24) then
  379. if (not(playerExists(reply, true))) then showMessage("Gracz " .. reply .. " nie istnieje", true)
  380. elseif (reply~="") then
  381. playEmoteTarget = reply
  382. ui.addPopup(25, 2, "[CZYNNOŚĆ]\nNumer czynności (0-16)", adm, 270, 150, 250, true)
  383. end
  384. elseif (id==25) then
  385. if (tonumber(reply) > 0 and tonumber(reply) < 16) then
  386. if (playEmoteTarget~="*") then
  387. tfm.exec.playEmote(playEmoteTarget, reply)
  388. showMessage("Emotka (" .. reply .. ") aktywowana dla gracza " .. playEmoteTarget)
  389. else
  390. for n in next, tfm.get.room.playerList do tfm.exec.playEmote(n, reply) end
  391. showMessage("Emotka (" .. reply .. ") aktywowana dla wszystkich graczy")
  392. end
  393. else showMessage("Podany numer jest niepoprawny (0 - 16)", true) end
  394. elseif (id==26) then
  395. if (reply~="") then
  396. actObject = true
  397. objectId = reply
  398. system.bindMouse(adm, true)
  399. showMessage("Obiekt (" .. reply .. ") gotowy do użycia (użyj myszki by zespawnować)")
  400. end
  401. end
  402. end
  403. end
  404.  
  405. function eventNewPlayer(n)
  406. if (actFly==true and flyTarget=="*") then
  407. for n in next, tfm.get.room.playerList do system.bindKeyboard(n, 32, true) end
  408. end
  409. if (disappearPlayers[n]) then tfm.exec.killPlayer(n) end
  410. end
  411.  
  412. function eventMouse(n, x, y)
  413. if (n==tpTarget and actTp==true or tpTarget=="*" and actTp==true) then tfm.exec.movePlayer(n, x, y, false, 1, 1) end
  414. if (n==adm and actObject==true) then tfm.exec.addShamanObject(objectId, x, y) end
  415. end
  416.  
  417. function eventKeyboard(n, key)
  418. if (key==32 and n==flyTarget and actFly==true or key==32 and flyTarget=="*" and actFly==true) then tfm.exec.movePlayer(n, 0, 0, true, 0, -flyPower, true) end
  419. if (key==speedKeys[1] and n==speedNMTarget and actSpeedNM==true or key==speedKeys[1] and speedNMTarget=="*" and actSpeedNM==true) then tfm.exec.movePlayer(n, 0, 0, true, speedNmPower, 0, true) end
  420. if (key==speedKeys[2] and n==speedNMTarget and actSpeedNM==true or key==speedKeys[2] and speedNMTarget=="*" and actSpeedNM==true) then tfm.exec.movePlayer(n, 0, 0, true, -speedNmPower, 0, true) end
  421.  
  422. if (n==adm) then
  423. if (controlTarget~="*") then
  424. if (key==controlKeys[1] and actControl==true) then tfm.exec.movePlayer(controlTarget, 0, 0, true, 0, -controlPower)
  425. elseif (key==controlKeys[2] and actControl==true) then tfm.exec.movePlayer(controlTarget, 0, 0, true, -controlPower)
  426. elseif (key==controlKeys[3] and actControl==true) then tfm.exec.movePlayer(controlTarget, 0, 0, true, 0, controlPower)
  427. elseif (key==controlKeys[4] and actControl==true) then tfm.exec.movePlayer(controlTarget, 0, 0, true, controlPower, 0) end
  428. else
  429. for n in next, tfm.get.room.playerList do
  430. if (key==controlKeys[1] and actControl==true) then tfm.exec.movePlayer(n, 0, 0, true, 0, -controlPower)
  431. elseif (key==controlKeys[2] and actControl==true) then tfm.exec.movePlayer(n, 0, 0, true, -controlPower)
  432. elseif (key==controlKeys[3] and actControl==true) then tfm.exec.movePlayer(n, 0, 0, true, 0, controlPower)
  433. elseif (key==controlKeys[4] and actControl==true) then tfm.exec.movePlayer(n, 0, 0, true, controlPower, 0) end
  434. end
  435. end
  436. end
  437. end
  438.  
  439. function eventColorPicked(id, n, color)
  440. if (id==2) then
  441. if (nameColorTarget=="*") then
  442. for n in next, tfm.get.room.playerList do tfm.exec.setNameColor(n, color) end
  443. else tfm.exec.setNameColor(nameColorTarget, color) end
  444. showMessage("Kolor nazwy zmienony pomyślnie")
  445. end
  446. end
  447.  
  448. function eventLoop()
  449. if (actRainbow==true) then
  450. if (rainbowTarget=="*") then
  451. for n in next, tfm.get.room.playerList do ui.addTextArea(4, "", n, -400, -200, 1600, 1200, "0x" .. rainbowColors[i]) end
  452. else ui.addTextArea(4, "", rainbowTarget, -400, -200, 1600, 1200, "0x" .. rainbowColors[i])
  453. end
  454. i=i+1
  455. if (i > #rainbowColors) then i=1 end
  456. end
  457. if (actParticles==true) then
  458. if (particlesTarget=="*") then tfm.exec.displayParticle(math.random(0,42), math.random(50,750), math.random(50,350), nil, nil, nil, nil)
  459. else tfm.exec.displayParticle(math.random(0,42), math.random(50,750), math.random(50,350), nil, nil, nil, nil, particlesTarget) end
  460. end
  461. if (actAutoSpeed==true) then
  462. if (autoSpeedTarget=="*") then
  463. for n in next, tfm.get.room.playerList do
  464. if (tfm.get.room.playerList[n].movingRight==true) then
  465. tfm.exec.movePlayer(n, 0, 0, true, autoSpeedPower)
  466. elseif (tfm.get.room.playerList[n].movingLeft==true) then
  467. tfm.exec.movePlayer(n, 0, 0, true, -autoSpeedPower)
  468. end
  469. end
  470. else
  471. if (tfm.get.room.playerList[autoSpeedTarget].movingRight==true) then
  472. tfm.exec.movePlayer(autoSpeedTarget, 0, 0, true, 100)
  473. elseif (tfm.get.room.playerList[autoSpeedTarget].movingLeft==true) then
  474. tfm.exec.movePlayer(autoSpeedTarget, 0, 0, true, -100)
  475. end
  476. end
  477. end
  478. if (actLockMove==true) then
  479. if (lockMoveTarget~="*") then
  480. if (currentLockMoveX==nil and currentLockMoveY==nil) then
  481. currentLockMoveX = tfm.get.room.playerList[lockMoveTarget].x
  482. currentLockMoveY = tfm.get.room.playerList[lockMoveTarget].y
  483. end
  484. tfm.exec.movePlayer(lockMoveTarget, currentLockMoveX, currentLockMoveY, false, 1, 1)
  485. else
  486. if (currentLockMoveX==nil and currentLockMoveY==nil) then
  487. currentLockMoveX = {}
  488. currentLockMoveY = {}
  489. for n in next, tfm.get.room.playerList do
  490. currentLockMoveX[n] = tfm.get.room.playerList[n].x
  491. currentLockMoveY[n] = tfm.get.room.playerList[n].y
  492. end
  493. end
  494. for n in next, tfm.get.room.playerList do tfm.exec.movePlayer(n, currentLockMoveX[n], currentLockMoveY[n], false, 1, 1) end
  495. end
  496. else currentLockMoveX=nil currentLockMoveY=nil end
  497.  
  498. if (actAutoExplosions==true) then
  499. if (autoExplosionsTarget~="*" and tfm.get.room.playerList[autoExplosionsTarget].isDead==false) then
  500. currentAutoExplosionsX = tfm.get.room.playerList[autoExplosionsTarget].x
  501. currentAutoExplosionsY = tfm.get.room.playerList[autoExplosionsTarget].y
  502. randomMarginX = math.random(-explosionsMarginX, explosionsMarginX)
  503. randomMarginY = math.random(-explosionsMarginY, explosionsMarginY)
  504. tfm.exec.explosion(currentAutoExplosionsX + randomMarginX, currentAutoExplosionsY + randomMarginY, explosionsPower, explosionsRange, true)
  505. tfm.exec.displayParticle(10, currentAutoExplosionsX + randomMarginX, currentAutoExplosionsY + randomMarginY)
  506. else
  507. currentAutoExplosionsX = {}
  508. currentAutoExplosionsY = {}
  509. randomMarginX = {}
  510. randomMarginY = {}
  511. for n in next, tfm.get.room.playerList do
  512. if (tfm.get.room.playerList[n].isDead==false) then
  513. currentAutoExplosionsX[n] = tfm.get.room.playerList[n].x
  514. currentAutoExplosionsY[n] = tfm.get.room.playerList[n].y
  515. randomMarginX[n] = math.random(-explosionsMarginX, explosionsMarginX)
  516. randomMarginY[n] = math.random(-explosionsMarginY, explosionsMarginY)
  517. tfm.exec.explosion(currentAutoExplosionsX[n] + randomMarginX[n], currentAutoExplosionsY[n] + randomMarginY[n], explosionsPower, explosionsRange, true)
  518. tfm.exec.displayParticle(10, currentAutoExplosionsX[n] + randomMarginX[n], currentAutoExplosionsY[n] + randomMarginY[n])
  519. end
  520. end
  521. end
  522. end
  523.  
  524. if (actMinGravity==true) then
  525. if (minGravityTarget~="*") then tfm.exec.movePlayer(minGravityTarget, 0, 0, true, 0, -minGravityPower)
  526. else for n in next, tfm.get.room.playerList do tfm.exec.movePlayer(n, 0, 0, true, 0, -minGravityPower) end end
  527. end
  528.  
  529. if (actDisappear==true) then
  530. if (disappearTarget~="*") then tfm.exec.movePlayer(disappearTarget, 400, -600, nil, nil, 1)
  531. else for n in next, tfm.get.room.playerList do tfm.exec.movePlayer(n, 400, -600, nil, nil, 1) end end
  532. end
  533.  
  534. if (messageWindowActive==true) then
  535. if (messageWindowStart==nil) then messageWindowStart = os.time() end
  536. if (os.time() > messageWindowStart + messageWindowTime) then
  537. ui.removeTextArea(5)
  538. messageWindowActive = nil
  539. messageWindowStart = nil
  540. end
  541. end
  542. end
  543. system.disableChatCommandDisplay()
  544. print("<font color='#00bb00'>Skrypt został wczytany poprawnie!\nUżyj komendy !ui aby pokazać menu</font>")
  545.  
  546. -- لقد فقدت بضع ثوانٍ من حياتك لترجمة هذا النقش
  547. -- by Boxofkrain#0000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement