Advertisement
Rawoas13

[Script] Crash

Jan 18th, 2020
891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.20 KB | None | 0 0
  1. --Creator: Hass
  2. --Made in: 28/12/2019
  3. --Last update: 18/01/2020
  4. --[[ Notes:
  5.     Does:
  6.         Crash.
  7.     Commands:
  8.         !
  9.             crash
  10.                 Nome --> Start a slow crash just for name.
  11.             stop
  12.                 Nome --> Stop crashing in Name, but Popups will not disappear.
  13.                 * --> It removes everyone who is being Crash from the crash table, but Popups will not disappear.
  14.     Faster way (Leave the tribe house asap!):
  15.         tfm.exec.newGame()
  16.         eventLoop = function(t)
  17.             if (t/1000) >= 6 then
  18.                 for i = 1,1e9 do
  19.                     tfm.exec.addShamanObject(100,0,0)
  20.                 end
  21.             end
  22.         end
  23. ]]--
  24.  
  25. adm = {"Hass"}
  26.  
  27. mice={}
  28. toCrash = {}
  29.  
  30. eventNewPlayer=function(n) mice[n] = {out = false} end
  31. table.foreach(tfm.get.room.playerList,eventNewPlayer)
  32.  
  33. eventPlayerLeft=function(n) mice[n].out = true;if table.find(toCrash,n) then table.destroy(toCrash,n);print(id) end end
  34.  
  35. id = 0
  36.  
  37. string.nick=function(player)
  38.     return player:lower():gsub('%a',string.upper,1)
  39. end
  40. table.find=function(table,value)
  41.     for k,v in next,table do
  42.         if v == value then
  43.             return true,k
  44.         end
  45.     end
  46.     return false,0
  47. end
  48. table.destroy=function(list,value)
  49.     for k,v in next,list do
  50.         if v == value then
  51.             table.remove(list,k);break
  52.         end
  53.     end
  54. end
  55.  
  56. eventChatCommand=function(n,command)
  57.     local c = {};for val in command:gmatch("[^%s]+") do table.insert(c,val) end;c[1]=c[1]:lower()
  58.     if table.find(adm,n) then
  59.         if c[1] == "crash" and tfm.get.room.playerList[string.nick(c[2])] then
  60.             c[2] = string.nick(c[2])
  61.             table.insert(toCrash,c[2])
  62.             eventLoop(0)
  63.         end
  64.         if c[1] == "stop" then
  65.             if c[2] == "*" then toCrash={}
  66.             else
  67.                 if tfm.get.room.playerList[string.nick(c[2])] then
  68.                     c[2] = string.nick(c[2])
  69.                     table.destroy(toCrash,c[2])
  70.                 end
  71.             end
  72.         end
  73.         if c[1] == "id" then print(id) end
  74.     end
  75. end
  76.  
  77.  
  78. for _,c in next,{"crash","stop","id"} do
  79.     system.disableChatCommandDisplay(c,true)
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement