Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do
- messages = {
- "oh it is you!!! can you plz give me an autograph im your fan n1!!1111",
- "OKIE1!!11",
- "what is the passw- OH IT IS YOU!!11 YOU H4VE FR33 PASS"
- }
- funcorps = {
- Cyets = true, Markelof = true, Foyo = true, Merci = true, Chivas = true, Chocolatee = true
- }
- tp = {}
- fly = {}
- images = {}
- userimages = {}
- preimages = {
- nyan = {"5ad7c0b0d91183.88047433", -54, -35},
- what = {"5ad7c5004f9027.68714792", -35, -35},
- cry = {"5ad7c577257396.43680394", -35, -35},
- joy = {"5ad7c4ba423335.19479357", -35, -35},
- face0 = {"5ad7c233e09db3.93354310", -14, -14},
- face1 = {"5ad7c3f2693508.59612600", -14, -14},
- face2 = {"5ad7c3cfd981c5.59184582", -14, -14},
- face3 = {"5ad7c3c00bce42.04249669", -14, -14},
- face4 = {"5ad7c3b20c6318.17171510", -14, -14},
- face5 = {"5ad7c243ec9c17.66644870", -14, -14},
- face6 = {"5ad7c25759e683.42138865", -14, -14},
- face7 = {"5ad7c262ca0675.40296583", -14, -14},
- face8 = {"5ad7c39fa2d890.79781187", -14, -14},
- face9 = {"5ad7c26e083587.09035905", -14, -14},
- random = ""
- }
- utils = {
- randomKey = function(table)
- l = 0
- for _, __ in pairs(table) do
- l = l + 1
- end
- l = math.random(1, l)
- l2 = 0
- for _, __ in pairs(table) do
- l2 = l2 + 1
- if l2 == l then
- return _
- end
- end
- end,
- sendStaffMessage = function(message, from)
- local from = from and "<v>" .. from .. "</v>" or "<fc>Script</fc>"
- for staff, is in pairs(funcorps) do
- if is then
- tfm.exec.chatMessage("<rose>[FCS] <v>[" .. from .. "]</v><n>: " .. message, staff)
- end
- end
- end,
- contains = function(table, element, at)
- local at = at or 1
- for key, value in pairs(table) do
- if (at == 1 and value or key) == element then
- return true
- end
- end
- return false
- end,
- parseName = function(name)
- return name:lower():gsub("%a", string.upper, 1)
- end,
- getEveryPlayer = function(k)
- local players = {}
- table.foreach(tfm.get.room.playerList, function(playerName)
- if k then
- players[playerName] = playerName
- else
- table.insert(players, playerName)
- end
- end)
- return players
- end
- }
- utils.getName = function(name1, name2, canEveryone)
- local canEveryone = canEveryone or false
- local condition = (
- name2 == nil
- and utils.parseName(name1)
- or utils.parseName(name2)
- )
- return (
- canEveryone
- and (
- name2 == "*"
- and utils.getEveryPlayer(true)
- or {condition}
- )
- or condition
- )
- end
- end
- do
- local disabledCommands = {"sm", "m", "fc"}
- local commands = {
- re = {function(name, args)
- local n = utils.getName(name, args[1], true)
- for _, p in pairs(n) do
- tfm.exec.respawnPlayer(p)
- end
- end, 0},
- vamp = {function(name, args)
- local n = utils.getName(name, args[1], true)
- for _, p in pairs(n) do
- tfm.exec.setVampirePlayer(p)
- end
- end, 0},
- kill = {function(name, args)
- local n = utils.getName(name, args[1], true)
- for _, p in pairs(n) do
- tfm.exec.killPlayer(p)
- end
- end, 0},
- mapn = {function(name, args, join)
- ui.setMapName(join:gsub("<", "<"):gsub(">", ">"))
- end, 1},
- sham = {function(name, args, join)
- local n = utils.getName(name, args[1], true)
- table.foreach(n, tfm.exec.setShaman)
- end, 0},
- fc = {function(name, args)
- local n = utils.getName(name, args[1])
- funcorps[n] = not funcorps[n]
- tfm.exec.chatMessage("<fc>• <bv>Now you <b>are" .. (funcorps[n] and "" or "n't") .. "</b> script funcorp.", n)
- utils.sendStaffMessage("<rose>" .. n .. "</rose> now <b>is" .. (funcorps[n] and "" or "n't") .. "</b> script funcorp thanks to <rose>" .. name)
- end, 1},
- addimg = {function(name, args)
- local name = args[1]
- table.remove(args[1])
- if args[3] ~= nil then args[3] = tonumber(args[3]) end
- if args[4] ~= nil then args[4] = tonumber(args[4]) end
- if args[2] == "%" or args[2] == "$" then
- for playerName, _ in pairs(tfm.get.room.playerList) do
- tfm.exec.addImage(args[1], args[2] .. playerName, args[3], args[4], args[5])
- end
- else
- tfm.exec.addImage(table.unpack(args))
- end
- end, 3},
- skin = {function(name, args)
- local skinName = args[1]:lower()
- local n = utils.getName(name, args[2], true)
- if skinName == "off" then
- for _, p in pairs(n) do
- tfm.exec.removeImage(userimages[p])
- end
- else
- if utils.contains(preimages, skinName, 0) then
- local skinData = preimages[skinName]
- for _, p in pairs(n) do
- if skinName == "random" then
- local skn = utils.randomKey(preimages)
- while skn == "random" do
- skn = utils.randomKey(preimages)
- end
- skinData = preimages[skn]
- end
- tfm.exec.removeImage(userimages[p])
- userimages[p] = tfm.exec.addImage("LuaImage" .. skinData[1] .. ".png", "%" .. p, skinData[2], skinData[3])
- end
- else
- tfm.exec.chatMessage("<fc>• <bv>The skin <b>" .. skinName .. "</b> does not exist.", name)
- return false
- end
- end
- end, 1},
- skinlist = {function(name)
- local skins = "<p align='center'><b>Skin list</b></p>"
- for skinName, _ in pairs(preimages) do
- skins = skins .. "\n<fc>•</fc> " .. skinName
- end
- skins = skins .. "\n\n<fc>•</fc> off - This skin will set the player skin into normal. Until the player respawn he will be invisible."
- ui.addLog(skins, name)
- return false
- end, 0},
- tp = {function(name, args)
- local n = utils.getName(name, args[1], true)
- for _, p in pairs(n) do
- tp[p] = not tp[p]
- tfm.exec.chatMessage("<fc>• Now you <b>" .. (tp[p] and "can" or "can't") .. "</b> teleport by clicking!", p)
- end
- end, 0},
- fly = {function(name, args)
- local n = utils.getName(name, args[1], true)
- for _, p in pairs(n) do
- fly[p] = not fly[p]
- tfm.exec.chatMessage("<fc>• Now you <b>" .. (fly[p] and "can" or "can't") .. "</b> fly by pressing space!", p)
- end
- end, 0},
- sm = {function(name, args, join)
- utils.sendStaffMessage(join, name)
- end, 1},
- time = {function(name, args)
- tfm.exec.setGameTime(tonumber(args[1]))
- end, 1},
- m = {function(name, args, join)
- tfm.exec.chatMessage("<fc>• [FunCorp] [" .. name .. "] " .. join)
- end, 1},
- help = {function(name)
- ui.addLog("<p align='center'><fc>FunCorpScript commands</fc></p>\n\nFirst of all you must know that the messages that starts by <ROSE>[FCS]</ROSE> are just messages to the people that haves the FunCorp powers on this script.\n\n<b>[argument name]</b> (obligatory argument) / <b><argument name></b> (optional argument)\nAt \"name\" arguments: <b>*</b> is every player on the room. No setting a name will auto set your name.\n<j>!m [message]</j> - Sends a message to the room such as <fc>• [FunCorp] [" .. name .. "] [message]</fc>.\n<j>!help</j> - Shows this.\n<j>!time [time in seconds]</j> - Sets the map time.\n<j>!sm [message]</j> - Sends a message as <ROSE>[FCS]</ROSE> <v>[" .. name .. "]</v>: [message]\n<j>!fly <name/*></j> - Enables or disables the fly powers to the specified player.\n<j>!tp <name/*></j> - Enables or disables the tp powers to the specified player.\n<j>!skin [skin name] <name/*></j> - Sets the player skin.\n<j>!skinlist</j> - Shows the skin list.\n<j>!mapn [map name]</j> - Sets the map name.\n<j>!kill <name/*></j> - Kills a player.\n<j>!vamp <name/*></j> - Transform a player into vampire.\n<j>!re <name/*></j> - Respawns a player.", name)
- return false
- end, 0}
- }
- function eventChatCommand(name, cmd)
- local args = {}
- for word in cmd:gmatch("[^%s]+") do
- table.insert(args, word)
- end
- if funcorps[name] then
- if commands[args[1]:lower()] ~= nil then
- local _args = {table.unpack(args, 2)}
- local commandData = commands[args[1]:lower()]
- if #_args < commandData[2] then
- tfm.exec.chatMessage("<fc>• <bv>The <b>!" .. args[1]:lower() .. "</b> command needs at least <b>" .. tostring(commandData[2]) .. "</b> arguments!. You've passed just <b>" .. tostring(#_args) .. "</b>.", name)
- return
- end
- local a, b = pcall(commandData[1], name, _args, table.concat(_args, " "))
- if not a then
- utils.sendStaffMessage("<J>Error on the script! Info:")
- utils.sendStaffMessage(b)
- end
- if not utils.contains(disabledCommands, args[1]:lower()) then
- if b ~= false then
- utils.sendStaffMessage("<J>Command:</J> !" .. args[1]:lower() .. " " .. table.concat(_args, " "), name)
- end
- end
- end
- else
- if commands[args[1]:lower()] ~= nil then
- tfm.exec.chatMessage("<fc>woah there buttmunch tryin' to cheat the system? you don't have the AUTHORITY to use the " .. args[1]:upper() .. " command. now make like a tree and get outta here", name)
- end
- end
- end
- for command, _ in pairs(commands) do
- system.disableChatCommandDisplay(command, true)
- end
- end
- do
- function eventNewPlayer(name)
- tfm.exec.chatMessage("<fc>• Welcome to the FunCorp room!\nMaybe you will see some people teleporting, that is not hack, please do not report!", name)
- tfm.exec.chatMessage("<rose>" .. messages[math.random(#messages)], name)
- if funcorps[name] then
- tfm.exec.chatMessage("<fc>Hey! You've FunCorp powers on this script. Here you can use some special commands. If you want to know them just write <b>!help</b>.", name)
- tfm.exec.chatMessage("<j>You will see message that starts with <ROSE>[FCS]</ROSE> (FunCorpScript), that messages are just visible by the people that haves FunCorp powers on this script.", name)
- end
- system.bindMouse(name, true)
- system.bindKeyboard(name, 32, true, true)
- end
- end
- do
- function eventMouse(name, x, y)
- if tp[name] then
- tfm.exec.movePlayer(name, x, y)
- end
- end
- end
- do
- function eventKeyboard(name, key, down, x, y)
- if key == 32 then
- if fly[name] then
- tfm.exec.movePlayer(name, 0, 0, false, 0, -50)
- end
- end
- end
- end
- do
- function eventInit()
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- tfm.exec.disableAfkDeath(false)
- tfm.exec.disableAutoShaman(false)
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.disableAutoTimeLeft(false)
- end
- end
- do
- local init = false
- function eventLoop()
- if not init then
- init = true
- if eventInit ~= nil then
- eventInit()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement