Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[]
- #########################################
- ✸Created By - Ctmce✸
- ✸Module version: v1.0_beta✸
- ✸Updated date: 10/26/2018✸
- #########################################
- Commands list:
- 1. !ms [MSG] = Send a message as a funcorp member.
- 2. !start = starts the game!
- 3. !stop = stops the game!
- 4. !g = will switch the ground(if current ground is lava , then it will switch it to dirt same with dirt to lava)!
- 5. !tp all = turn on the tp power(See Other powers list to know how to use it)!
- Other powers:
- 1. If tp power is on , then Mouse click anywhere in the map to teleport everyone aswell as you to the mouse position!
- 2. Hold Shift+Mouse click = spawn random objects in your mouse position!
- ]]
- lava={}
- backgrounds = {"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"}
- game = {
- admins = {"Noooooooorr#0000","Turkitutu#0000","Massi#0015","Omaraldin#1619"},
- time = 8,
- started = false,
- currentGround = "dirt",
- dirtTimer = nil,
- lavaTimer = nil,
- dirtCD = 3000,
- lavaCD = 10000,
- tArea = 10,
- objects = {1,2,3,4,6,7,10,39,59,60,62,68},
- maps = {"7214563","7273409"},
- objectsList = {},
- ground = {}
- };
- players = {}
- local looper = 0
- local reapet = truelocal
- tpAll = false
- local sObjects = false
- game.ground.lava = {type = 3,x = 800,y = 387,r = 0.2,f = 0.3,w = 1600,h = 37,gc = true,mc = false}
- game.ground.dirt = {type = 6,x = 800,y = 387,r = 0.2,f = 0.3,w = 1600,h = 37,gc = true,mc = true}
- translation = {
- en = {welcome="Welcome to FunCorp! Beware! THE FLOOR IS LAVA!!!",
- floorislava="THE FLOOR IS LAVA!",
- win="%s has won the game"},
- ar = {welcome="!أهلا بكم في الفانكورب! لقد تحولت الأرض الى حمم بركانية،كن حذرا",
- floorislava="!الأرض أصبحت حمم بركانية",
- win="!في الجولة %s فاز"},
- ru = {welcome="Добро пожаловать в FunCorp! Осторожно! ПОЛ - ЭТО ЛАВА!!!",
- floorislava="ПОЛ - ЭТО ЛАВА!",
- win="%s выиграл(а) этот раунд."},
- fr = {welcome="Bienvenue sur FunCorp! Attention ! Le sol est en lave!!!",
- floorislava="Le sol est en lave!!!",
- win="%s a gagné la ronde"},
- tr = {welcome="Funcorp'a Hoşgeldiniz! Dikkat! BU ZEMİN BİR LAV!",
- floorislava="BU ZEMİN BİR LAV!",
- win="%s oyunu kazandı."},
- }
- function tran(n, id)
- if translation[tfm.get.room.playerList[n].community] then
- return translation[tfm.get.room.playerList[n].community][id]
- else
- return translation["en"][id]
- end
- end
- function main()
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- system.disableChatCommandDisplay(nil,true)
- tfm.exec.disablePhysicalConsumables(true)
- changeMap()
- table.foreach(
- tfm.get.room.playerList,
- function(name)
- eventNewPlayer(name)
- end
- )
- end
- function changeMap()
- tfm.exec.newGame(game.maps[math.random(1,#game.maps)])
- end
- local setScore = function(name) tfm.exec.setPlayerScore(name, players[name].score, false) end
- local refreshTimers = function(ground) if ground == "dirt" then game.dirtTimer = 3 elseif ground == "lava" then game.lavaTimer = 10 else game.lavaTimer = 10 game.dirtTimer = 3 end end
- function removeObjects()
- for _,i in next,game.objectsList
- do
- tfm.exec.removeObject(i)
- end
- game.objectsList = {}
- end
- local resetProp = function() game.time = 60 game.tArea = 10 game.objectsList = {} game.currentGround = "dirt" refreshTimers() end
- local removeAreas = function() for _,area in next,{1,2,10} do ui.removeTextArea(area,nil) end end
- function alivePlrCount()
- local c = 0
- for n,p in pairs(tfm.get.room.playerList) do
- if not p.isDead then
- c = c + 1
- end
- end
- return c
- end
- local isAdmin = function(name) for _,n in next,game.admins do if n == name then return true end end return false end
- function spawnObjects(x,y)
- if game.started == true then
- local oC = math.ceil((game.time / 10 > 1 and game.time / 10 or 1))
- local g = false
- local a = nil
- if o == 62 then
- a = 90 g = true
- end
- if x ~= nil and y ~= nil then
- local o = game.objects[math.random(1,#game.objects)]
- if o == 62 then
- a = 90
- g = true
- else
- a = nil
- g = nil
- end
- local sO = tfm.exec.addShamanObject(o, x, y, (a and a or 0),0,0, (g or false)) table.insert(game.objectsList,sO)
- else
- for i=1,oC,1 do
- local o = game.objects[math.random(1,#game.objects)]
- if o == 62 then
- a = 90
- g = true
- else
- a = nil
- g = nil
- end
- 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)
- end
- end
- end
- end
- function groundSwitch()
- if game.started == true then
- if game.currentGround == "dirt" then
- local gP = game.ground.lava
- if not lava then lava = tfm.exec.addImage("173697132e1.png", "!1", 0, 350, nil) end
- 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})
- for n, player in next, tfm.get.room.playerList do
- ui.addTextArea(1, "<p align='center'><font size='40' color='#FF0000'>"..tran(n,"floorislava").."</font></p>", n, 140, 125, 520, 119, 0x324650, 0x000000, 0, true)
- end
- if not lava then lava = tfm.exec.addImage("173697132e1.png", "!1", 0, 350, nil) end
- refreshTimers(game.currentGround)
- game.currentGround = "lava"
- elseif game.currentGround == "lava" then
- local gP = game.ground.dirt
- for _,id in next,game.objectsList do
- tfm.exec.removeObject(id)
- end
- if lava then tfm.exec.removeImage(lava) lava = nil end
- 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})
- refreshTimers(game.currentGround) game.currentGround = "dirt"
- end
- end
- end
- function giveWin(name)
- tfm.exec.giveCheese(name)
- tfm.exec.playerVictory(name)
- players[name].score = players[name].score + 1
- setScore(name)
- end
- function setGround(g)
- if game.started == false then
- game.currentGround = g
- local gP = game.ground[g]
- 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})
- else
- game.currentGround = g
- local gP = game.ground[g]
- 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})
- refreshTimers(game.currentGround)
- end
- end
- function eventNewGame()
- if game.started == true then
- Background = backgrounds[math.random(#backgrounds)]
- tfm.exec.addImage(Background, "_0", 0, 0, n)
- resetProp()
- system.removeTimer(meep)
- meep = nil
- reapet = true
- tfm.exec.setGameTime(game.time, true)
- setGround("dirt")
- meep = system.newTimer(function() table.foreach(tfm.get.room.playerList,function(name) tfm.exec.giveMeep(name) end) end,35000,false)
- else
- resetProp()
- setGround("dirt")
- end
- end
- function eventNewPlayer(name)
- if Background then tfm.exec.addImage(Background, "_0", 0, 0, name) end
- if players[name] then
- players[name].score = 0
- setScore(name)
- else
- players[name] = {score = 0}
- setScore(name)
- end
- tfm.exec.chatMessage("<font color='#FF7F0F'>"..tran(name,"welcome").."\n",name)
- if isAdmin(name) then
- system.bindMouse(name, true)
- system.bindKeyboard(name, 16, false, true)
- system.bindKeyboard(name, 16, true, true)
- end
- end
- function eventPlayerDied(name)
- if game.started == true then
- if alivePlrCount() <= 1 then
- reapet = false removeAreas()
- for name,p in next,tfm.get.room.playerList do
- if not p.isDead then
- for n, player in next, tfm.get.room.playerList do
- ui.addTextArea(2, "<p align='center'><font size='30' color='#FFFF00'>"..string.format(tran(n,"win"),name).."</font></p>", n, 50, 250, 700, 500, 0x324650, 0x000000, 0, true)
- ui.addTextArea(1, "<p align='center'><font size='50' color='#FF0000'>"..tran(n,"floorislava").." </font></p>", n, 50, 125, 700, 119, 0x324650, 0x000000, 0, true)
- end
- giveWin(name)
- end
- end
- system.newTimer(function() removeAreas() changeMap() end, 5000, false)
- end
- end
- end
- function eventChatCommand(name, command)
- local arg={}
- for argument in command:gmatch('[^%s]+') do
- table.insert(arg,argument)
- end
- if isAdmin(name) == true then
- if arg[1] == "ms" and arg[2] ~= nil then
- local t = command:find('%s')
- local msg = command:sub(t+1)
- tfm.exec.chatMessage("<Fc>• [" ..name .."]:</Fc><CE> " ..msg .."</CE>")
- end
- if arg[1] == "tp" and arg[2] == "all" then
- 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)
- tpAll = true
- end
- if arg[1] == "start" then
- if not game.started then
- game.started = true
- changeMap()
- end
- elseif arg[1] == "stop" then
- if game.started == true then
- game.started = false
- removeAreas()
- changeMap()
- end
- elseif arg[1] == "g" then
- removeAreas()
- spawnObjects()
- groundSwitch()
- end
- end
- end
- function eventKeyboard(name, key, Keydown, x, y)
- if isAdmin(name) then
- if key == 16 then
- if Keydown then
- sObjects = true
- else
- sObjects = false
- end
- end
- end
- end
- function
- eventMouse(name, x, y)
- if isAdmin(name) then
- if sObjects == true then
- spawnObjects(x,y)
- end
- if tpAll == true then
- for n,p in pairs(tfm.get.room.playerList) do
- tfm.exec.movePlayer(n,x,y,false,0,0,false)
- end
- tpAll = false
- end
- end
- end
- function eventLoop(cT, tR)
- if game.started == true and reapet == true then
- tR = tR / 1000
- game.time = tR
- looper = looper + 0.5
- if looper == 1 then
- if game.currentGround == "lava" then
- if game.dirtTimer > 0 then
- game.dirtTimer = game.dirtTimer - 1 elseif
- game.dirtTimer <= 0 then
- groundSwitch()
- ui.removeTextArea(1, nil)
- end
- end
- if game.currentGround == "dirt" then
- if game.lavaTimer > 0 then
- if game.lavaTimer == 4 then
- spawnObjects()
- end
- ui.addTextArea(10, "<p align='center'><font color='0xffffff' face='soopafresh'><font size='90'>" ..game.lavaTimer .."</font></p>", nil, 340, 125, 120, 119, 0x324650, 0x000000, 0, true)
- game.lavaTimer = game.lavaTimer - 1
- elseif
- game.lavaTimer <= 0 then
- ui.removeTextArea(10,nil)groundSwitch()
- end
- end
- looper = 0
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement