Advertisement
xCharliex

Glade Admin

Nov 21st, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. --[[
  2.  
  3. G L A D E
  4.  
  5. A D M I N
  6.  
  7. ]]--
  8.  
  9. local cmds = {
  10.     {
  11.         Cmd = "print",
  12.         Callback = function(args)
  13.             print("hello")
  14.         end
  15.     }
  16. }
  17.  
  18. function addMsg(message, player)
  19.     local msg = nil
  20.     if string.len(message) >= 3 then return true end
  21.     if string.sub(message, 1, 3) == "gl/" then
  22.         msg = string.sub(message, 4)
  23.     end
  24.     for i,v in pairs(cmds) do
  25.         if string.sub(msg, 1, string.len(v.Cmd)) == v.Cmd then
  26.             v.Callback({
  27.                 Author = player,
  28.                 MessageLeft = string.sub(msg, string.len(v.Cmd) + 1)
  29.             })
  30.         end
  31.     end
  32. end
  33.  
  34. game.Players.PlayerAdded:connect(function(plr)
  35.     plr.Chatted:connect(function(msg)
  36.         addMsg(msg, plr)
  37.     end)
  38.     local msg = Instance.new("Message", Workspace)
  39.     msg.Text = "[Glade Admin] "..plr.Name.." has joined"
  40.     wait(2.5)
  41.     msg:Destroy()
  42. end)
  43.  
  44. game.Players.PlayerRemoving:connect(function(plr)
  45.     local msg = Instance.new("Message", Workspace)
  46.     msg.Text = "[Glade Admin] "..plr.Name.." has left"
  47.     wait(2.5)
  48.     msg:Destroy()
  49. end)
  50.  
  51. for i,v in pairs(game.Players:GetChildren()) do
  52.     v.Chatted:connect(function(msg)
  53.         addMsg(msg, v)
  54.     end)
  55. end
  56.  
  57. local l = Instance.new("Hint", game.Workspace)
  58.  
  59. l.Text = "Glade Admin has been loaded in this server!"
  60.  
  61. wait(2.5)
  62.  
  63. l:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement