Advertisement
aiden50_70

Untitled

Jun 16th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. function chat(f)
  2. local A_1 = f
  3. local A_2 = "All"
  4. local Event = game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest
  5. Event:FireServer(A_1, A_2)
  6. end
  7.  
  8. function split(s)
  9. local a = {}s:gsub("%S+",function(c)table.insert(a,c)end)return a
  10. end
  11.  
  12. local greetings = {"hi","hello","how are you doing"}
  13. local players = game:GetService("Players")
  14. local locked = nil
  15.  
  16. players.PlayerAdded:Connect(function(plr)
  17. chat(greetings[math.random(1,#greetings)]..", ".. plr.Name)
  18. plr.Chatted:Connect(function(msg)
  19. local args = split(msg)
  20. if args[1] == "hello" or args[1] == "hi" then
  21. chat("hello, "..plr.Name)
  22. end
  23. if args[1] == ";enable" then
  24. if locked == nil then
  25. chat("Congratulations! I am now your player bot, ".. plr.Name)
  26. else
  27. chat("Ooooops... I am ".. locked.Name.. "'s player bot.")
  28. end
  29. end
  30. end)
  31. end)
  32. players.LocalPlayer.Chatted:Connect(function(msg)
  33. local args = split(msg)
  34. if args[1]==";lock" then
  35. local ok, err = pcall(function()
  36. locked = game.Players[args[2]]
  37. end)
  38. if ok then
  39. chat("Binded to ".. args[2])
  40. else
  41. chat("[Run Time Error]")
  42. chat(err)
  43. end
  44. end
  45. end)
  46.  
  47. repeat wait() until locked~=nil
  48. locked.Chatted:Connect(function(msg)
  49. do
  50. local args = split(msg)
  51. if args[1] == ";bot" then
  52. if args[2] == "disable" then
  53. chat("Disabling player bot...")
  54. locked = nil
  55. end
  56. if args[2] == "bring" then
  57. local ok, err = pcall(function()
  58. players.LocalPlayer.Character:MoveTo(locked.Character.Head.Position)
  59. end)
  60. if ok then
  61. chat("Run success!")
  62. else
  63. chat("Run failure:")
  64. chat(err)
  65. end
  66. end
  67. if args[2] == "execute" then
  68. local ret = {}
  69. local ok, err = pcall(function()
  70. local code = ""
  71. for i = 3, #args do
  72. code = code.."\32"..args[i]
  73. end
  74. local env = {
  75. print = function(...)
  76. table.insert(ret,...)
  77. end
  78. }
  79. local func = loadstring(code)
  80. assert(not (type(func) == "nil" or type(func) == "string"), "Syntax error . . . Check script!")
  81. spawn(setfenv(func, setmetatable(env, {__index = getfenv()})))
  82. end)
  83. if ok then
  84. chat("Code Run Success!")
  85. chat(unpack(ret))
  86. else
  87. chat("Code Error:")
  88. chat(err)
  89. end
  90. end
  91. end
  92. end
  93. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement