Safwanrockz

Advanced Drawing Tool

Feb 10th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. for name,player in pairs(tfm.get.room.playerList) do
  2.      system.bindMouse(name,true)
  3. end
  4.  
  5. id=0
  6. color = "0xFFFFFF"
  7. brush=1
  8. smallBrush = false
  9.  
  10. function eventChatCommand(n,c)
  11.      local arg={}
  12.      for argument in c:gmatch("[^%s]+") do
  13.          table.insert(arg, argument)
  14.      end
  15.      if c=="clear" then
  16.          for i=1,id do
  17.              ui.removeTextArea(i)
  18.          end
  19.      elseif c=="undo" then
  20.          ui.removeTextArea(id)
  21.          id=id-1
  22.      elseif arg[1]=="undo" then
  23.          for i=tonumber(arg[2]),id do
  24.              ui.removeTextArea(i)
  25.          end
  26.          id=id-tonumber(arg[2])
  27.      elseif arg[1]=="setcolor" then
  28.          color="0x"..arg[2]
  29.      elseif arg[1]=="brush" and tonumber(arg[2])<=20 and tonumber(arg[2])~=0 and not smallBrush then
  30.          brush=arg[2]
  31.          smallBrush = false
  32.      elseif arg[1]=="smallbrush" then
  33.          smallBrush = true
  34.      end
  35. end
  36.  
  37. function eventMouse(name,x,y)
  38.      id = id + 1
  39.      if not smallBrush then
  40.          ui.addTextArea(id, "", nil, x, y, brush, brush, color, color)
  41.      elseif smallBrush then
  42.          ui.addTextArea(id, "<font size='20' color="..color..">•</font>", nil, x-8, y-17, brush+40, brush+40, color, color, 0.0)
  43.      end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment