Advertisement
TempusMoon

Untitled

May 5th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. local user = "Guardian_Artwena"
  2. local player = game.Players[user];
  3. local httpservice = game:GetService("HttpService");
  4. local Com,ComH;
  5.  
  6.  
  7. function ClearComs()
  8. if ComEvent then ComEvent:disconnect() end
  9. if ComEventH then ComEventH:disconnect() end
  10. for _,v in pairs(Workspace:GetChildren()) do
  11. if v.Name == "Com" or v.Name == "ComH" then
  12. v:Destroy();
  13. end
  14. end
  15. end
  16. ClearComs();
  17.  
  18. function spawnCom()
  19. Com = Instance.new("RemoteEvent",Workspace);
  20. Com.Name = "Com";
  21. ComEvent = Com.OnServerEvent:connect(function(plr,str,char,stype)
  22. print(char,stype);
  23. if stype == "NS" then
  24. NS(str,char);
  25. elseif stype == "NLS" then
  26. NLS(str,char);
  27. end
  28. end)
  29. end
  30.  
  31. function spawnComH()
  32. ComH = Instance.new("RemoteEvent",Workspace);
  33. ComH.Name = "ComH";
  34. ComEventH = ComH.OnServerEvent:connect(function(plr,humanoid,state)
  35. humanoid:ChangeState(state);
  36. end)
  37. end
  38.  
  39. Workspace.ChildRemoved:connect(function(o)
  40. if o.Name == "Com" then
  41. ClearComs();
  42. spawnCom();
  43. end
  44. if o.Name == "ComH" then
  45. ClearComs();
  46. spawnComH();
  47. end
  48. end)
  49.  
  50. spawnCom();
  51. spawnComH();
  52.  
  53.  
  54.  
  55. function findcharacter(str)
  56. for _,v in pairs(game:GetService("Players"):GetPlayers()) do
  57. if v.Name:lower():sub(1,3) == str:lower():sub(1,3) and v.Character then
  58. return v.Character;
  59. end
  60. end
  61. end
  62. player.Chatted:connect(function(msg)
  63. msg = msg:lower();
  64. local animal,char = msg:match("(.+)/(.+)")
  65. if not animal or not char then return end
  66. if char == "me" then char = user end
  67. local client;
  68. if animal == "sheep" then
  69. client = httpservice:GetAsync("http://pastebin.com/raw.php?i=d22jxX1A");
  70. elseif animal == "chicken" then
  71. client = httpservice:GetAsync("http://pastebin.com/raw.php?i=WhfZUjWg");
  72. elseif animal == "user" then
  73. client = httpservice:GetAsync("http://pastebin.com/raw.php?i=sn3TiD7J");
  74. elseif animal == "pig" then
  75. client = httpservice:GetAsync("http://pastebin.com/raw.php?i=BHK6Yhq4");
  76. end
  77.  
  78. if animal == "me" then
  79. client = httpservice:GetAsync("http://pastebin.com/raw.php?i=tF1tkXqQ");
  80. end
  81. if char ~= "all" then
  82. local character = findcharacter(char);
  83. if not character then return end
  84. NLS(client,character);
  85. else
  86. for _,v in pairs(game.Players:GetPlayers()) do
  87. if v.Character then
  88. NLS(client,v.Character);
  89. end
  90. end
  91. end
  92. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement