Advertisement
Terrah

Test lua

Oct 14th, 2014
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1.  
  2. MOD.LastMsgUsr = {};
  3.  
  4. local function Join(user)
  5.     print(user.." has joined");
  6. end
  7.  
  8. local function Leave(user)
  9.     print(user.." has left");
  10. end
  11.  
  12. local function Msg(user,msg)
  13.  
  14.     MOD.LastMsgUsr[user:lower()] = msg;
  15. end
  16.  
  17. local function LastMsg(msg)
  18.  
  19.     local txt = MOD.LastMsgUsr[msg:lower()];
  20.  
  21.     if not txt then
  22.         return;
  23.     end
  24.  
  25.     print("Last msg by " .. msg .. " was: " .. txt);
  26. end
  27.  
  28.  
  29. MOD.SetUserJoinEvent(Join);
  30. MOD.SetUserLeaveEvent(Leave);
  31. MOD.SetUserMsgEvent(Msg);
  32. MOD.AddCom("last",LastMsg);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement