NoorTFM

الأرض تحولت إلى حمض مميت

Mar 6th, 2021 (edited)
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.62 KB | None | 0 0
  1.    --[[]
  2.     #########################################
  3.         ✸Created By - Ctmce✸
  4.         ✸Modified (Acid version) by Trexexjc#0000✸✸
  5.         ✸Module version: v1.1✸
  6.         ✸Updated date: 24/01/2021✸
  7.     #########################################
  8.     Commands list:
  9.     !ms [MSG] = Send a message as a funcorp member.
  10.     !start = starts the game!
  11.     !stop = stops the game!
  12.     !g = will switch the ground(if current ground is acid , then it will switch it to dirt same with dirt to acid)!
  13.     !tp all = turn on the tp power(See Other powers list to know how to use it)!
  14.     !kill [Username] = Kills the player, useful for people that glitch out or bug
  15.     !snow = Toggles on snow for a minute
  16.     !wind [Wind] = Changes wind to desired parameters. Example !wind 10. Default is 0
  17.     !gravity [Gravity] = Changes gravity to desired value. Default is 10
  18.     NOTE: Gravity and wind changes only apply per round.
  19.     !climate default = Changes wind and gravity back to default
  20.     !cheese [Username] = Gives cheese to desired player
  21.     !respawn [Username] = Respawns desired player
  22.     !vampire [Username] = Converts desired player into a vampire
  23.     !joke = Surprise!
  24.     !help = Explains how the minigame works!
  25.     Other powers:
  26.     1. If tp power is on , then Mouse click anywhere in the map to teleport everyone aswell as you to the mouse position!
  27.     2. Hold Shift+Mouse click = spawn random objects in your mouse position!
  28.     ]]
  29.  
  30.     game = {
  31.         admins = { ["Noooooooorr#0000"] = true , ["Kiwi_is_here#0558"] = true},
  32.         time = 60,
  33.         started = false,
  34.         currentGround = "dirt",
  35.         dirtTimer = nil,
  36.         acidTimer = nil,
  37.         dirtCD = 3000,
  38.         acidCD = 10000,
  39.         tArea = 10,    
  40.         objects = {1,109,119,124,219,217,226,228,313,316,323,325,422,424,411,409,622,615,610,620,701,702,701,702,1006,1009,1010,1007,39,39,59,59,60,60,60,60,62,62,68,68,68,68,23,23,90,90,40,40,40,40,40,40,57,57,61,61,61,69,69,46,46,45,45,45,45,45,54,1716,1719,1715,1723,89,89,2825,2823,2829,2827},
  41.         maps = {"7819891","7819896"},
  42.         objectsList = {},
  43.         ground = {},
  44.         lmao = {"مساء العنبر ممكن النمبر","مساء الفرفشة ممكن دردشة","أنت نوب هههه","البطاطا لذيذة! حقيقة لا يمكن إنكارها"},
  45.         backgrounds = {"173cf0990b3.png","173cf03fa86.png","173cf0392da.png","17372d45dca.jpg","17372d3d135.png","1736d136ca9.png","1736d34a204.png","17369683742.jpg","173695d6d70.jpg","17369524d79.jpg","17369524d79.jpg","1736951e776.jpg","17305a13915.png","172fd0940c4.png","172fd0847d7.png","1712c2e573f.png","1711ecc824b.jpg","1711e9a5172.jpg","1711e9a072a.jpg","1711e8ce5f7.jpg","1711e8ca452.jpg","1711e8c0569.jpg","165245b5238.jpg","1700112d165.jpg","17001097f5a.jpg","170013d6683.jpg"}
  46.     };
  47.     players = {}
  48.     local looper = 0
  49.     local reapet = truelocal
  50.     local wind=0
  51.     local gravity=10
  52.  
  53.     tpAll = false
  54.     local sObjects = false
  55.     game.ground.acid = {type = 19,x = 800,y = 387,r = 0.2,f = 0.3,w = 1600,h = 37,gc = true,mc = true}
  56.     game.ground.dirt = {type = 17,x = 800,y = 387,r = 0.2,f = 0.3,w = 1600,h = 37,gc = true,mc = true}
  57.  
  58.  
  59.     function main()
  60.         tfm.exec.disableAutoNewGame(true)
  61.         tfm.exec.disableAutoTimeLeft(true)
  62.         tfm.exec.disableAutoShaman(true)
  63.         tfm.exec.disableAutoScore(true)
  64.         system.disableChatCommandDisplay(nil,true)
  65.         tfm.exec.disablePhysicalConsumables(true)
  66.         tfm.exec.setRoomMaxPlayers(200)
  67.         tfm.exec.disableMinimalistMode(true)
  68.         changeMap()
  69.         table.foreach(
  70.             tfm.get.room.playerList,
  71.             function(name)
  72.                 eventNewPlayer(name)
  73.             end
  74.         )
  75.     end
  76.  
  77.     function changeMap()
  78.         tfm.exec.newGame(game.maps[math.random(1,#game.maps)])
  79.         ui.setMapName("<font color='#02FD00'>حمض مميت</font><font color='#009d9d'> لقد تحولت الأرض إلى</font>")
  80.     end
  81.  
  82.     local setScore = function(name) tfm.exec.setPlayerScore(name, players[name].score, false) end
  83.     local refreshTimers = function(ground) if ground == "dirt" then game.dirtTimer = 3 elseif ground == "acid" then game.acidTimer = 10 else game.acidTimer = 10 game.dirtTimer = 3 end end
  84.  
  85.     function removeObjects()
  86.         for _,i in next,game.objectsList
  87.         do
  88.             tfm.exec.removeObject(i)
  89.         end
  90.         game.objectsList = {}
  91.     end
  92.  
  93.     local resetProp = function() game.time = 60 game.tArea = 10 game.objectsList = {} game.currentGround = "dirt" refreshTimers() end
  94.     local removeAreas = function() for _,area in next,{1,2,10} do ui.removeTextArea(area,nil) end end
  95.  
  96.     function alivePlrCount()
  97.         local c = 0
  98.         for n,p in pairs(tfm.get.room.playerList) do
  99.             if not p.isDead then
  100.                 c = c + 1
  101.             end
  102.         end
  103.         return c
  104.     end
  105.  
  106.     local isAdmin = function(name) if game.admins[name] then return true else return false end end
  107.  
  108.     function spawnObjects(x,y)
  109.         if game.started == true then
  110.             local oC = math.ceil((game.time / 10 > 1 and game.time / 10 or 1))
  111.             local g = false
  112.             local a = nil
  113.             if o == 62 then
  114.                 a = 90 g = true
  115.             end
  116.             if x ~= nil and y ~= nil then
  117.                 local o = game.objects[math.random(1,#game.objects)]
  118.                 if o == 62 then
  119.                     a = 90
  120.                     g = true
  121.                 else
  122.                     a = nil
  123.                     g = nil
  124.                 end
  125.                 local sO = tfm.exec.addShamanObject(o, x, y, (a and a or 0),0,0, (g or false)) table.insert(game.objectsList,sO)
  126.             else
  127.                 for i=1,oC,1 do
  128.                     local o = game.objects[math.random(1,#game.objects)]
  129.                     if o ==  62  then
  130.                         a = 90
  131.                         g = true
  132.                     else
  133.                         a = nil
  134.                         g = nil
  135.                     end
  136.                     local sO = tfm.exec.addShamanObject(o, math.random(100,1500), 360, (a and a or 0),0,0, (g or false)) table.insert(game.objectsList,sO)
  137.                 end
  138.             end
  139.         end
  140.     end  
  141.                    
  142.     function groundSwitch()
  143.         if game.started == true then
  144.             if game.currentGround == "dirt" then
  145.                 local gP = game.ground.acid
  146.                 tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
  147.                 ui.addTextArea(1, "<p align='center'><font size='30' color='#00FF21'>لقد تحولت الأرض إلى حمض مميت</font></p>", nil, 140, 125, 520, 119, 0x324650, 0x000000, 0, true)
  148.                 refreshTimers(game.currentGround)
  149.                 game.currentGround = "acid"
  150.             elseif game.currentGround == "acid" then
  151.                 local gP = game.ground.dirt
  152.                 for _,id in next,game.objectsList do
  153.                     tfm.exec.removeObject(id)
  154.                 end
  155.                 tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
  156.                 refreshTimers(game.currentGround) game.currentGround = "dirt"
  157.             end
  158.         end
  159.     end
  160.  
  161.  
  162.     function decToHex(color)
  163.         local b,k,out,i,d=16,"0123456789ABCDEF","",0
  164.         while color>0 do
  165.             i=i+1 color,d=math.floor(color/b),color%b+1 out=string.sub(k,d,d)..out
  166.         end
  167.         return out
  168.     end
  169.  
  170.     function admins_msg(msg)    
  171.         for admin in next, game.admins do
  172.            tfm.exec.chatMessage(msg, admin)
  173.         end
  174.     end
  175.    
  176.     function eventColorPicked(id, name, color)
  177.         if color>0 then
  178.             if id==0 then
  179.                 tfm.exec.chatMessage("<CE> سيتم تلبية طلبك بتغيير لون اسمك : <font color='#"..decToHex(color).."'># ", name)
  180.                 admins_msg("<VP>/colornick "..name.." </VP><font color='#"..decToHex(color).."'>#"..decToHex(color).."</font>")
  181.             end
  182.         else
  183.             tfm.exec.chatMessage("<R>.لا يمكن إختيار هذا اللون [•]", name)
  184.         end
  185.     end
  186.  
  187.     function giveWin(name)
  188.         tfm.exec.setVampirePlayer(name, false)
  189.         tfm.exec.giveCheese(name)
  190.         tfm.exec.playerVictory(name)
  191.         players[name].score = players[name].score + 1
  192.         setScore(name)
  193.         if players[name].score == 1 then
  194.             tfm.exec.chatMessage(
  195.                     "<ROSE>ما هو اللون الذي تريده لاسمك؟، !" ..name.." أحسنت عملًا يا •</ROSE>"
  196.                 )
  197.                 ui.showColorPicker(0, name, 0xFFFFFF,"جائزة تغيير لون الاسم")
  198.  
  199.             elseif players[name].score == 2 then
  200.                 tfm.exec.chatMessage(
  201.                     "<ROSE>!" ..name.." أحسنت عملًا يا  ،سيتم تكبير فأرك •</ROSE>"
  202.                 )
  203.                 tfm.exec.changePlayerSize(name, 2)
  204.  
  205.             elseif players[name].score == 3 then
  206.                 tfm.exec.chatMessage(
  207.                     "<ROSE>!لقد فزت ثلاثة مرات ، سيتم تكبير فأرك أكثر في الجولة الثانية  " ..name.." مدهش يا •</ROSE>"
  208.                 )
  209.                 tfm.exec.changePlayerSize(name, 3)
  210.  
  211.             elseif players[name].score == 4 then
  212.                 tfm.exec.chatMessage(
  213.                     "<ROSE>!بأربعة جولات! مبارك! سوف تكبر أكثر و أكثر " ..name.." لقد فاز •</ROSE>"
  214.                 )
  215.                 tfm.exec.changePlayerSize(name, 4)
  216.  
  217.             elseif players[name].score == 5 then
  218.                 tfm.exec.chatMessage(
  219.                     "<ROSE>!سيحصل فأرك على أكبر حجم " ..name.." خمسة مرات، بجد؟ مبارك يا •</ROSE>"
  220.                 )
  221.                 tfm.exec.changePlayerSize(name, 5)
  222.  
  223.             elseif players[name].score == 6 then
  224.                 tfm.exec.chatMessage(
  225.                     "<ROSE>وصلت بالفعل إلى الحجم الأقصى!هل تريد الحصول على اسم مختلف؟ " ..name.." •</ROSE>"
  226.                 )
  227.             else
  228.                 tfm.exec.chatMessage(
  229.                     "<font color='#F89F4B'>[Funcorp]</font> <font color='#C2C2DA'>!أحسنت عملًا،" ..name.." مذهل يا</font>"
  230.                 )
  231.         end
  232.     end
  233.  
  234.     function setGround(g)
  235.         if game.started == false then
  236.             game.currentGround = g
  237.             local gP = game.ground[g]
  238.             tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
  239.         else
  240.             game.currentGround = g
  241.             local gP = game.ground[g]
  242.             tfm.exec.addPhysicObject(1, gP.x, gP.y, {type = gP.type,width = gP.w,height = gP.h,foreground = false,friction = gP.f, restitution = gP.r, angle = 0, miceCollision = gP.mc, groundCollision = gP.gc})
  243.             refreshTimers(game.currentGround)
  244.         end
  245.     end
  246.  
  247.     function eventNewGame()
  248.         Background = game.backgrounds[math.random(#game.backgrounds)]
  249.         tfm.exec.addImage(Background, "_0", 0, 0)    
  250.         if game.started == true then
  251.             resetProp()
  252.             system.removeTimer(meep)
  253.             system.removeTimer(cheese)
  254.             meep = nil
  255.             cheese = nil
  256.             reapet = true
  257.             tfm.exec.setGameTime(game.time, true)
  258.             setGround("dirt")
  259.             meep = system.newTimer(function() table.foreach(tfm.get.room.playerList,function(name)
  260.             tfm.exec.giveMeep(name)
  261.         end) end,35000,false)
  262.             cheese = system.newTimer(function() table.foreach(tfm.get.room.playerList,function(name) tfm.exec.giveCheese(name) end) end,65000,false)
  263.         else
  264.             resetProp()
  265.             setGround("dirt")
  266.         end
  267.     end
  268.  
  269.     function eventNewPlayer(name)
  270.         if players[name] then
  271.             players[name].score = 0
  272.             setScore(name)
  273.         else
  274.             players[name] = {score = 0}
  275.             setScore(name)
  276.         end
  277.         if Background then
  278.             tfm.exec.addImage(Background, "_0", 0, 0, name)
  279.         end  
  280.             tfm.exec.chatMessage(
  281.         "<font color='#ff8547'>مرحبًا بك في الفانكورب!- لقد تحولت الأرض إلى حمض مميت</font><br><br>" ..
  282.         "<font color='#D9BF1C'>Module made by Osicat#0000, remade by Ctmce#0000, edited by Trexexjc#0000. Special thanks to Ork#0015 for the maps! <3<br>" ..
  283.         "<font color='#30ba76'><br>" ..
  284.         "<font color='#30ba76'>!الفائز بجولة يمكن أن يحصل على لون لاسمه من اختياره<br>!و إذا فزت أكتر من مرتيين فسوف يكبر حجم فأرك<br>" ..
  285.         "<font color='#30ba76'>.تقوم باستعمال الثغرات . سيتم طرد كل من يستعمل الثغرات <b>لا</b> •<br>" ..
  286.         ".تقوم بتكرار الكلام المزعج ، أو سوف يتم طردك من الغرفة <b>لا</b> •</font><br><br><font color='#ff8547'>", name
  287.     )
  288.         if isAdmin(name) then
  289.             system.bindMouse(name, true)
  290.             system.bindKeyboard(name, 16, false, true)
  291.             system.bindKeyboard(name, 16, true, true)
  292.         end
  293.     end
  294.  
  295.     function eventPlayerDied(name)
  296.         if game.started == true then
  297.             if alivePlrCount() <= 1 then
  298.                 reapet = false removeAreas()
  299.                 for name,p in next,tfm.get.room.playerList do
  300.                     if not p.isDead then
  301.                         ui.addTextArea(2, "<p align='center'><font size='30' color='#FFFF00'>!فاز بالجولة "..name.."</font></p>", nil, 50, 250, 700, 500, 0x324650, 0x000000, 0, true)
  302.                         tfm.exec.chatMessage("<font color='#EAE633'>!فاز بالجولة " ..name.."", player)
  303.                         ui.addTextArea(1, "<p align='center'><font size='30' color='00FF21'>لقد تحولت الأرض إلى حمض مميت</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true)
  304.                         giveWin(name)
  305.                     end
  306.                 end
  307.                 system.newTimer(function() removeAreas() changeMap() end, 5000, false)
  308.             end
  309.         end
  310.     end
  311.        
  312.     function eventChatCommand(name, command)
  313.         local arg={}
  314.         for argument in command:gmatch('[^%s]+') do
  315.             table.insert(arg,argument)
  316.         end
  317.         if isAdmin(name) == true then
  318.             if arg[1] == "ms" and arg[2] ~= nil then
  319.                 local t = command:find('%s')
  320.                 local msg = command:sub(t+1)
  321.                 tfm.exec.chatMessage("<font color='#F95705'>• [" ..name .."]:</font><font color='#FF8547'> " ..msg .."</font>")
  322.             end
  323.             if arg[1] == "tp" and arg[2] == "all" then
  324.                 tfm.exec.chatMessage("<font color='#F95705'>• [FuncorpBot]:</font><bv> You turned ON tp power! <b>Mouse click</b> anywhere on the screen to teleport everyone!</bv>",name)
  325.                 tpAll = true
  326.             end
  327.             if arg[1] == "start" then
  328.                 if not game.started then
  329.                     game.started = true
  330.                     changeMap()
  331.                 end
  332.             elseif arg[1] == "stop" then
  333.                 if game.started == true then
  334.                     game.started = false
  335.                     removeAreas()
  336.                     changeMap()
  337.                 end
  338.             elseif arg[1] == "g" then
  339.                 removeAreas()
  340.                 spawnObjects()
  341.                 groundSwitch()
  342.  
  343.             elseif arg[1] == "kill" then
  344.                 tfm.exec.killPlayer(arg[2])
  345.  
  346.             elseif arg[1] == "snow" then
  347.                 tfm.exec.snow(60, 10)
  348.                   tfm.exec.chatMessage(
  349.                     "<font color='#C2C2DA'>!أنظر! إنها تُثلج</font> <font color='#F89F4B'>[الفانكورب]</font>"
  350.                 )
  351.             elseif arg[1] == "climate" and arg[2] == "default" then
  352.                 wind = 0
  353.                 gravity = 10
  354.                 tfm.exec.setWorldGravity(wind,gravity)
  355.                   tfm.exec.chatMessage(
  356.                     "<font color='#C2C2DA'>!نحن بأمان ، ولت تغيرات الرياح والجاذبية</font> <font color='#F89F4B'>[الفانكورب]</font>"
  357.                 )
  358.             elseif arg[1] == "wind" then
  359.                 wind = arg[2]
  360.                 tfm.exec.setWorldGravity(wind,gravity)
  361.  
  362.                   tfm.exec.chatMessage(
  363.                     "<font color='#C2C2DA'>!يبدو أن هناك بعض التغييرات على الريح</font> <font color='#F89F4B'>[الفانكورب]</font>"
  364.                 )
  365.  
  366.                  elseif arg[1] == "gravity" then
  367.                 gravity = arg[2]
  368.                 tfm.exec.setWorldGravity(wind,gravity)
  369.  
  370.                   tfm.exec.chatMessage(
  371.                     "<font color='#C2C2DA'>!يبدو أن هناك بعض التغييرات في الجاذبية</font> <font color='#F89F4B'>[الفانكورب]</font>"
  372.                 )
  373.  
  374.             elseif arg[1] == "cheese" then
  375.                     tfm.exec.giveCheese(arg[2])
  376.  
  377.             elseif arg[1] == "respawn" then
  378.                     tfm.exec.respawnPlayer(arg[2])
  379.  
  380.             elseif arg[1] == "vampire" then
  381.                     tfm.exec.setVampirePlayer(arg[2], true)
  382.  
  383.             elseif arg[1] == "joke" then
  384.                     local theJoke = game.lmao[math.random(#game.lmao)]
  385.                       tfm.exec.chatMessage(
  386.                     "<font color='#C2C2DA'>سنقوم بعمل مزحة خفيفة !! الرجاء من الجميع كتابة</font> <font color='#F89F4B'>[الفانكورب]</font>\n <font color='#ffffff'> /c "..arg[2].." "..theJoke.." </font>"
  387.                 )
  388.              elseif arg[1] == "help" then
  389.                       tfm.exec.chatMessage(
  390.                     "<font color='#F89F4B'>[Funcorp]</font> <font color='#F89F4B'>في المرة الأولى التي تفوز فيها ، ستحصل على تغيير في اسم اللون ، إذا فزت مرة أخرى ستصبح كبيرًا ، وستستمر في النمو من هناك! اتمنى ان تستمتع! <3</font>"
  391.                 )
  392.  
  393.  
  394.             end
  395.         end
  396.     end
  397.            
  398.     function eventKeyboard(name, key, Keydown, x, y)
  399.     if isAdmin(name) then
  400.         if key == 16 then
  401.             if Keydown then
  402.                 sObjects = true
  403.             else
  404.                 sObjects = false
  405.             end
  406.         end
  407.     end
  408.     end
  409.  
  410.     function
  411.     eventMouse(name, x, y)
  412.     if isAdmin(name) then
  413.         if sObjects == true then
  414.             spawnObjects(x,y)
  415.         end
  416.         if tpAll == true then
  417.             for n,p in pairs(tfm.get.room.playerList) do
  418.                 tfm.exec.movePlayer(n,x,y,false,0,0,false)
  419.             end
  420.             tpAll = false
  421.         end
  422.     end
  423.     end
  424.  
  425.     function eventLoop(cT, tR)
  426.     if game.started == true and reapet == true then
  427.         tR = tR / 1000
  428.         game.time = tR
  429.         looper = looper + 0.5
  430.         if looper == 1 then
  431.             if game.currentGround == "acid" then
  432.                 if game.dirtTimer > 0  then
  433.                     game.dirtTimer = game.dirtTimer - 1 elseif
  434.                     game.dirtTimer <= 0 then
  435.                         groundSwitch()
  436.                         ui.removeTextArea(1, nil)
  437.                     end
  438.                 end
  439.                 if game.currentGround == "dirt" then
  440.                     if game.acidTimer > 0 then
  441.                         if game.acidTimer == 4 then
  442.                             spawnObjects()
  443.                         end
  444.                         ui.addTextArea(10, "<p align='center'><font size='90'>" ..game.acidTimer .."</font></p>", nil, 340, 125, 120, 119, 0x324650, 0x000000, 0, true)
  445.                         game.acidTimer = game.acidTimer - 1
  446.                     elseif
  447.                     game.acidTimer <= 0 then
  448.                         ui.removeTextArea(10,nil)groundSwitch()
  449.                     end
  450.                 end
  451.                 looper = 0
  452.             end
  453.         end
  454.     end
  455.  
  456.     main()
Add Comment
Please, Sign In to add comment