DrakerMaker

AI

Sep 4th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. char.Archivable = true
  4. local bot = char:Clone()
  5. bot.Parent = owner.Character
  6. bot.Name = "Hi! I am your AI, I obey you. Command me to do a thing and I will do it!"
  7. local moving = true
  8. local attackingwho = ""
  9. local spot = Instance.new("Part", owner.Character)
  10. spot.Anchored = true
  11. spot.CanCollide = false
  12. spot.Transparency = 1
  13. spot.CFrame = char.HumanoidRootPart.CFrame *CFrame.new(5, 0, 0)
  14. local punch = Instance.new("Sound", bot.HumanoidRootPart)
  15. punch.SoundId = "rbxassetid://1089136667"
  16. punch.Volume = 2
  17. move = coroutine.wrap(function()
  18. while game:GetService("RunService").Stepped:wait() do
  19. if moving == true then
  20. bot:FindFirstChildOfClass("Humanoid"):MoveTo(spot.Position)
  21. if char:FindFirstChildOfClass("Humanoid").Jump == true then
  22. bot:FindFirstChildOfClass("Humanoid").Jump = true
  23. end
  24. end
  25. if moving == false then
  26. if attackingwho ~= "" then
  27. if workspace[attackingwho]:FindFirstChild("Torso") then
  28. bot:FindFirstChildOfClass("Humanoid"):MoveTo(workspace[attackingwho]:FindFirstChild("Torso").Position)
  29. if workspace[attackingwho]:FindFirstChildOfClass("Humanoid").Jump == true then
  30. bot:FindFirstChildOfClass("Humanoid").Jump = true
  31. end
  32. end
  33. if workspace[attackingwho]:FindFirstChild("UpperTorso") then
  34. bot:FindFirstChildOfClass("Humanoid"):MoveTo(workspace[attackingwho]:FindFirstChild("UpperTorso").Position)
  35. if workspace[attackingwho]:FindFirstChildOfClass("Humanoid").Jump == true then
  36. bot:FindFirstChildOfClass("Humanoid").Jump = true
  37. end
  38. end
  39. end
  40. end
  41. end
  42. end)move()
  43. move2 = coroutine.wrap(function()
  44. while game:GetService("RunService").Stepped:wait() do
  45. spot.CFrame = char.HumanoidRootPart.CFrame *CFrame.new(5, 0, 0)
  46. end
  47. end)move2()
  48. funct1 = coroutine.wrap(function()
  49. while game:GetService("RunService").Stepped:wait() do
  50. if attackingwho ~= "" then
  51. if workspace[attackingwho]:FindFirstChildOfClass("Humanoid").Health == 0 then
  52. bot.Name = "Task done, master."
  53. moving = true
  54. attacking = ""
  55. end
  56. end
  57. end
  58. end)funct1()
  59. plr.Chatted:connect(function(msg)
  60. if msg:sub(1,6) == "Attack" then
  61. if workspace:FindFirstChild(msg:sub(8)) then
  62. if workspace[msg:sub(8)].Name ~= owner.Name then
  63. bot:FindFirstChildOfClass("Humanoid").Sit = false
  64. bot.Name = "Got it, attacking "..msg:sub(8).." master!"
  65. attackingwho= msg:sub(8)
  66. moving = false
  67. end
  68. if workspace[msg:sub(8)].Name == owner.Name then
  69. bot.Name = "I'm sorry but I don't attack you master."
  70. end
  71. end
  72. end
  73. if msg:sub(1,3) == "Say" then
  74. bot.Name = msg:sub(5)
  75. end
  76. if msg == "Sit" then
  77. bot:FindFirstChildOfClass("Humanoid").Sit = true
  78. end
  79. if msg == "Get up" then
  80. bot:FindFirstChildOfClass("Humanoid").Sit = false
  81. bot:FindFirstChildOfClass("Humanoid").PlatformStand = false
  82. end
  83. if msg == "Clone" then
  84. local C = owner.Character:Clone()
  85. C.Parent = workspace
  86. C.Name = "Clone"
  87. C[bot.Name]:Destroy()
  88. end
  89. if msg == "DeSpAcItO" then
  90. bot.Name = [[
  91. Despacito
  92. Quiero respirar tu cuello despacito
  93. Deja que te diga cosas al oído
  94. Para que te acuerdes si no estás conmigo
  95. ]]
  96. end
  97. if msg == "GoT dAt?" then
  98. bot.Name = [[
  99. I like you 'cause you got that somethin'
  100. That I need in my life so give it to me
  101. 'Cause you got that
  102. (Who?) Like you 'cause you got that somethin'
  103. That I need in my life, that I need, so
  104. 'Cause you got that
  105. I like you 'cause you got that somethin'
  106. That I need in my life so give it to me
  107. 'Cause you got that
  108. (Who?) Like you 'cause you got that somethin'
  109. That I need in my life, that I need, so (so, so, so)
  110. 'Cause you got that
  111. ]]
  112. end
  113. if msg == "Play dead" then
  114. bot:FindFirstChildOfClass("Humanoid").PlatformStand = true
  115. if bot:FindFirstChild("Torso") then
  116. Instance.new("BodyForce", bot.Torso).Force = Vector3.new(0, 0, 15)
  117. end
  118. if bot:FindFirstChild("UpperTorso") then
  119. Instance.new("BodyForce", bot.Torso).Force = Vector3.new(0, 0, 15)
  120. end
  121. end
  122. end)
  123. bot.HumanoidRootPart.Touched:connect(function(p)
  124. if p.Parent.Name == attackingwho then
  125. p.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(5)
  126. bot.HumanoidRootPart.Anchored = true
  127. punch:Play()
  128. for i = 1,5 do
  129. wait()
  130. bot.HumanoidRootPart.CFrame = bot.HumanoidRootPart.CFrame *CFrame.Angles(0, 0.9, 0)
  131. end
  132. for i = 1,5 do
  133. wait()
  134. bot.HumanoidRootPart.CFrame = bot.HumanoidRootPart.CFrame *CFrame.Angles(0, -0.9, 0)
  135. end
  136. bot.HumanoidRootPart.Anchored = false
  137. end
  138. end)
  139. bot:FindFirstChildOfClass("Humanoid").Died:connect(function()
  140. bot.Name = "Agh!"
  141. end)
Add Comment
Please, Sign In to add comment