Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.05 KB | None | 0 0
  1. do
  2. messages = {
  3. "oh it is you!!! can you plz give me an autograph im your fan n1!!1111",
  4. "OKIE1!!11",
  5. "what is the passw- OH IT IS YOU!!11 YOU H4VE FR33 PASS"
  6. }
  7.  
  8. funcorps = {
  9. Cyets = true, Markelof = true, Foyo = true, Merci = true, Chivas = true, Chocolatee = true
  10. }
  11.  
  12. tp = {}
  13. fly = {}
  14.  
  15. images = {}
  16.  
  17. userimages = {}
  18. preimages = {
  19. nyan = {"5ad7c0b0d91183.88047433", -54, -35},
  20. what = {"5ad7c5004f9027.68714792", -35, -35},
  21. cry = {"5ad7c577257396.43680394", -35, -35},
  22. joy = {"5ad7c4ba423335.19479357", -35, -35},
  23. face0 = {"5ad7c233e09db3.93354310", -14, -14},
  24. face1 = {"5ad7c3f2693508.59612600", -14, -14},
  25. face2 = {"5ad7c3cfd981c5.59184582", -14, -14},
  26. face3 = {"5ad7c3c00bce42.04249669", -14, -14},
  27. face4 = {"5ad7c3b20c6318.17171510", -14, -14},
  28. face5 = {"5ad7c243ec9c17.66644870", -14, -14},
  29. face6 = {"5ad7c25759e683.42138865", -14, -14},
  30. face7 = {"5ad7c262ca0675.40296583", -14, -14},
  31. face8 = {"5ad7c39fa2d890.79781187", -14, -14},
  32. face9 = {"5ad7c26e083587.09035905", -14, -14},
  33.  
  34. random = ""
  35. }
  36.  
  37. utils = {
  38. randomKey = function(table)
  39. l = 0
  40. for _, __ in pairs(table) do
  41. l = l + 1
  42. end
  43. l = math.random(1, l)
  44. l2 = 0
  45. for _, __ in pairs(table) do
  46. l2 = l2 + 1
  47. if l2 == l then
  48. return _
  49. end
  50. end
  51. end,
  52. sendStaffMessage = function(message, from)
  53. local from = from and "<v>" .. from .. "</v>" or "<fc>Script</fc>"
  54.  
  55. for staff, is in pairs(funcorps) do
  56. if is then
  57. tfm.exec.chatMessage("<rose>[FCS] <v>[" .. from .. "]</v><n>: " .. message, staff)
  58. end
  59. end
  60. end,
  61. contains = function(table, element, at)
  62. local at = at or 1
  63. for key, value in pairs(table) do
  64. if (at == 1 and value or key) == element then
  65. return true
  66. end
  67. end
  68. return false
  69. end,
  70. parseName = function(name)
  71. return name:lower():gsub("%a", string.upper, 1)
  72. end,
  73. getEveryPlayer = function(k)
  74. local players = {}
  75.  
  76. table.foreach(tfm.get.room.playerList, function(playerName)
  77. if k then
  78. players[playerName] = playerName
  79. else
  80. table.insert(players, playerName)
  81. end
  82. end)
  83.  
  84. return players
  85. end
  86. }
  87. utils.getName = function(name1, name2, canEveryone)
  88. local canEveryone = canEveryone or false
  89. local condition = (
  90. name2 == nil
  91. and utils.parseName(name1)
  92. or utils.parseName(name2)
  93. )
  94. return (
  95. canEveryone
  96. and (
  97. name2 == "*"
  98. and utils.getEveryPlayer(true)
  99. or {condition}
  100. )
  101. or condition
  102. )
  103. end
  104. end
  105.  
  106. do
  107. local disabledCommands = {"sm", "m", "fc"}
  108.  
  109. local commands = {
  110. re = {function(name, args)
  111. local n = utils.getName(name, args[1], true)
  112. for _, p in pairs(n) do
  113. tfm.exec.respawnPlayer(p)
  114. end
  115. end, 0},
  116.  
  117. vamp = {function(name, args)
  118. local n = utils.getName(name, args[1], true)
  119. for _, p in pairs(n) do
  120. tfm.exec.setVampirePlayer(p)
  121. end
  122. end, 0},
  123.  
  124. kill = {function(name, args)
  125. local n = utils.getName(name, args[1], true)
  126. for _, p in pairs(n) do
  127. tfm.exec.killPlayer(p)
  128. end
  129. end, 0},
  130.  
  131. mapn = {function(name, args, join)
  132. ui.setMapName(join:gsub("&lt;", "<"):gsub("&gt;", ">"))
  133. end, 1},
  134.  
  135. sham = {function(name, args, join)
  136. local n = utils.getName(name, args[1], true)
  137. table.foreach(n, tfm.exec.setShaman)
  138. end, 0},
  139.  
  140. fc = {function(name, args)
  141. local n = utils.getName(name, args[1])
  142. funcorps[n] = not funcorps[n]
  143.  
  144. tfm.exec.chatMessage("<fc>• <bv>Now you <b>are" .. (funcorps[n] and "" or "n't") .. "</b> script funcorp.", n)
  145. utils.sendStaffMessage("<rose>" .. n .. "</rose> now <b>is" .. (funcorps[n] and "" or "n't") .. "</b> script funcorp thanks to <rose>" .. name)
  146. end, 1},
  147.  
  148. addimg = {function(name, args)
  149. local name = args[1]
  150. table.remove(args[1])
  151. if args[3] ~= nil then args[3] = tonumber(args[3]) end
  152. if args[4] ~= nil then args[4] = tonumber(args[4]) end
  153.  
  154. if args[2] == "%" or args[2] == "$" then
  155. for playerName, _ in pairs(tfm.get.room.playerList) do
  156. tfm.exec.addImage(args[1], args[2] .. playerName, args[3], args[4], args[5])
  157. end
  158. else
  159. tfm.exec.addImage(table.unpack(args))
  160. end
  161. end, 3},
  162.  
  163. skin = {function(name, args)
  164. local skinName = args[1]:lower()
  165. local n = utils.getName(name, args[2], true)
  166. if skinName == "off" then
  167. for _, p in pairs(n) do
  168. tfm.exec.removeImage(userimages[p])
  169. end
  170. else
  171. if utils.contains(preimages, skinName, 0) then
  172. local skinData = preimages[skinName]
  173.  
  174. for _, p in pairs(n) do
  175. if skinName == "random" then
  176. local skn = utils.randomKey(preimages)
  177. while skn == "random" do
  178. skn = utils.randomKey(preimages)
  179. end
  180. skinData = preimages[skn]
  181. end
  182.  
  183. tfm.exec.removeImage(userimages[p])
  184.  
  185. userimages[p] = tfm.exec.addImage("LuaImage" .. skinData[1] .. ".png", "%" .. p, skinData[2], skinData[3])
  186. end
  187. else
  188. tfm.exec.chatMessage("<fc>• <bv>The skin <b>" .. skinName .. "</b> does not exist.", name)
  189. return false
  190. end
  191. end
  192. end, 1},
  193.  
  194. skinlist = {function(name)
  195. local skins = "<p align='center'><b>Skin list</b></p>"
  196.  
  197. for skinName, _ in pairs(preimages) do
  198. skins = skins .. "\n<fc>•</fc> " .. skinName
  199. end
  200.  
  201. skins = skins .. "\n\n<fc>•</fc> off - This skin will set the player skin into normal. Until the player respawn he will be invisible."
  202.  
  203. ui.addLog(skins, name)
  204. return false
  205. end, 0},
  206.  
  207. tp = {function(name, args)
  208. local n = utils.getName(name, args[1], true)
  209. for _, p in pairs(n) do
  210. tp[p] = not tp[p]
  211.  
  212. tfm.exec.chatMessage("<fc>• Now you <b>" .. (tp[p] and "can" or "can't") .. "</b> teleport by clicking!", p)
  213. end
  214. end, 0},
  215.  
  216. fly = {function(name, args)
  217. local n = utils.getName(name, args[1], true)
  218. for _, p in pairs(n) do
  219. fly[p] = not fly[p]
  220.  
  221. tfm.exec.chatMessage("<fc>• Now you <b>" .. (fly[p] and "can" or "can't") .. "</b> fly by pressing space!", p)
  222. end
  223. end, 0},
  224.  
  225. sm = {function(name, args, join)
  226. utils.sendStaffMessage(join, name)
  227. end, 1},
  228.  
  229. time = {function(name, args)
  230. tfm.exec.setGameTime(tonumber(args[1]))
  231. end, 1},
  232.  
  233. m = {function(name, args, join)
  234. tfm.exec.chatMessage("<fc>• [FunCorp] [" .. name .. "] " .. join)
  235. end, 1},
  236.  
  237. help = {function(name)
  238. 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>&lt;argument name&gt;</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 &lt;name/*&gt;</j> - Enables or disables the fly powers to the specified player.\n<j>!tp &lt;name/*&gt;</j> - Enables or disables the tp powers to the specified player.\n<j>!skin [skin name] &lt;name/*&gt;</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 &lt;name/*&gt;</j> - Kills a player.\n<j>!vamp &lt;name/*&gt;</j> - Transform a player into vampire.\n<j>!re &lt;name/*&gt;</j> - Respawns a player.", name)
  239. return false
  240. end, 0}
  241. }
  242.  
  243. function eventChatCommand(name, cmd)
  244. local args = {}
  245. for word in cmd:gmatch("[^%s]+") do
  246. table.insert(args, word)
  247. end
  248.  
  249. if funcorps[name] then
  250. if commands[args[1]:lower()] ~= nil then
  251. local _args = {table.unpack(args, 2)}
  252. local commandData = commands[args[1]:lower()]
  253.  
  254. if #_args < commandData[2] then
  255. 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)
  256. return
  257. end
  258.  
  259. local a, b = pcall(commandData[1], name, _args, table.concat(_args, " "))
  260.  
  261. if not a then
  262. utils.sendStaffMessage("<J>Error on the script! Info:")
  263. utils.sendStaffMessage(b)
  264. end
  265.  
  266. if not utils.contains(disabledCommands, args[1]:lower()) then
  267. if b ~= false then
  268. utils.sendStaffMessage("<J>Command:</J> !" .. args[1]:lower() .. " " .. table.concat(_args, " "), name)
  269. end
  270. end
  271. end
  272. else
  273. if commands[args[1]:lower()] ~= nil then
  274. 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)
  275. end
  276. end
  277. end
  278.  
  279. for command, _ in pairs(commands) do
  280. system.disableChatCommandDisplay(command, true)
  281. end
  282. end
  283.  
  284. do
  285. function eventNewPlayer(name)
  286. 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)
  287. tfm.exec.chatMessage("<rose>" .. messages[math.random(#messages)], name)
  288. if funcorps[name] then
  289. 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)
  290. 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)
  291. end
  292. system.bindMouse(name, true)
  293. system.bindKeyboard(name, 32, true, true)
  294. end
  295. end
  296.  
  297. do
  298. function eventMouse(name, x, y)
  299. if tp[name] then
  300. tfm.exec.movePlayer(name, x, y)
  301. end
  302. end
  303. end
  304.  
  305. do
  306. function eventKeyboard(name, key, down, x, y)
  307. if key == 32 then
  308. if fly[name] then
  309. tfm.exec.movePlayer(name, 0, 0, false, 0, -50)
  310. end
  311. end
  312. end
  313. end
  314.  
  315. do
  316. function eventInit()
  317. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  318.  
  319. tfm.exec.disableAfkDeath(false)
  320. tfm.exec.disableAutoShaman(false)
  321. tfm.exec.disableAutoNewGame(false)
  322. tfm.exec.disableAutoTimeLeft(false)
  323. end
  324. end
  325.  
  326. do
  327. local init = false
  328.  
  329. function eventLoop()
  330. if not init then
  331. init = true
  332. if eventInit ~= nil then
  333. eventInit()
  334. end
  335. end
  336. end
  337. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement