NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

--[[]
#########################################
✸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!
]]

game = {
admins = {"Ted#0015"},
time = 60,
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}

function main()
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)
system.disableChatCommandDisplay(nil,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
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})
ui.addTextArea(1, "<p align='center'><font size='50' color='#FF0000'>THE FLOOR IS LAVA</font></p>", nil, 140, 125, 520, 119, 0x324650, 0x000000, 0, true)
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
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
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 players[name] then
players[name].score = 0
setScore(name)
else
players[name] = {score = 0}
setScore(name)
end
tfm.exec.chatMessage("<font color='#FF7F0F'>Welcome to FunCorp! Beware! THE FLOOR IS LAVA!!! Round winner gets <font color='#D9BF1C'>5 cheese</font>.n(Module originally made by: <B>Osicat#0000</B>)nThis is a remake made by: <b>Ctmce#0000 </b>!</font>",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
ui.addTextArea(2, "<p align='center'><font size='50' color='#FFFF00'>"..name.." has won the game</font></p>", nil, 50, 250, 700, 500, 0x324650, 0x000000, 0, true)
ui.addTextArea(1, "<p align='center'><font size='50' color='#FF0000'>THE FLOOR IS LAVA</font></p>", nil, 50, 125, 700, 119, 0x324650, 0x000000, 0, true)
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("<font color='#F95705'>• [" ..name .."]:</font><font color='#FF8547'> " ..msg .."</font>")
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 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()
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.