Hachem16

My Improved English (JK)

Oct 29th, 2015
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.70 KB | None | 0 0
  1. ---------- A VERY OLD SCRIPT THAT I SIMPLY *added* THE NEW FEATURE IN --------------
  2. Players = {}
  3. admins = {"Abdeltif", "Perttymice", "YourNameHere"}
  4. ui.addTextArea(0, "", nil, 50,50,nil,nil, 0x0055FF, 0x0022FF, 0.65, true)
  5.  
  6.  
  7. function eventNewPlayer(name)
  8.         tfm.exec.bindKeyboard(name, 32, false, true)
  9.         Players[name] = {}
  10.         Players[name].part = 0
  11.         Players[name].admin = off
  12.     end
  13. for k,v in pairs(tfm.get.room.playerList) do
  14.         eventNewPlayer(k)
  15. end
  16. for k,v in pairs(admins) do
  17.     eventNewPlayer(v)
  18.     Players[v].admin = true
  19. end
  20. function eventChatCommand(name, cmd) --COMMANDS AREA
  21. local cmds = {}
  22.     for arg in cmd:gmatch("[^%s]+") do
  23.         table.insert(cmds, arg)
  24.     end
  25.     if cmds[1] == "say" then
  26.         local str = "Those are the following :\n"
  27.         for k,v in pairs(cmds) do
  28.             str = str..v.."\n"
  29.         end
  30.        
  31.         ui.updateTextArea(0, str, nil)
  32.     elseif cmds[1] == "meep" then
  33.         if cmds[2] == nil then nole = name else nole = cmds[2] end
  34.         tfm.exec.giveMeep(nole)
  35.     elseif cmds[1] == "vamp" then
  36.         if name ~= "Abdeltif" then return end
  37.         if cmds[2] == nil then nole = name else nole = cmds[2] end
  38.         tfm.exec.setVampirePlayer(nole)
  39.     elseif cmds[1] == "part" then
  40.         local newed = tonumber(cmds[2])
  41.         if newed == nil or type(newed)~="number" or newed>37 or newed<0 then
  42.             ui.addPopup(1, 0, "You need to insert a particle between 0 and 37 (!part [0to37])", name, 50, 50, nil, true)
  43.             return
  44.         end
  45.         Players[name].part = cmds[2]
  46. elseif cmds[1] == "tp" then
  47.         print(cmds[2])
  48.         if Players[name].admin == false  then
  49.             ui.addPopup(1, 0, "You are not an admin !", name, 50, 100, nil, true)
  50.             return
  51.         elseif (not cmds[2] == "on") or (not cmds[2] == "off") or (not cmds[2]) then
  52.             ui.addPopup(1, 0, "use !tp ON or !tp OFF to switch the click-teleportation skill", name, 50, 100, nil, true)
  53.             return
  54.         end
  55.         if string.lower(cmds[2]) == "on" then
  56.             system.bindMouse(name, true)
  57.             Players[name].tp = true
  58.         elseif string.lower(cmds[2]) == "off" then
  59.             Players[name].tp = false
  60.         end
  61. elseif cmds[1] == "colour" or cmds[1] == "color" then
  62.     ui.showColorPicker(1, name, 0xF581A1, "Choose your best Name color!")
  63. end
  64.  
  65. end
  66.  
  67.  
  68. function eventColorPicked( id, name, color)
  69.     local b = id == 1 and tfm.exec.setNameColor(name, color)
  70. end
  71.  
  72. function project(x,y,part,xs) -- Used for particles
  73.         for i=0,30,10 do
  74.             tfm.exec.displayParticle(part, x, y+i, xs, 0,0,0,nil)
  75.         end
  76. end
  77.  
  78.  
  79.  
  80. function eventKeyboard(name, key, down, x, y) -- For keyboard
  81. if key == 32 then
  82.         if tfm.get.room.playerList[name].isFacingRight then
  83.             project(x,y,Players[name].part, 3)
  84.         else
  85.             project(x,y,Players[name].part, -3)
  86.         end
  87. end
  88. end
  89. function eventMouse(name, x, y)
  90.     if Players[name].tp then
  91.         tfm.exec.movePlayer(name, x, y)
  92.     end
  93. end
Advertisement
Add Comment
Please, Sign In to add comment