mewishmeww

Ai

Apr 29th, 2023 (edited)
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.44 KB | None | 0 0
  1. local debris = game:GetService("Debris")
  2. local CS = game:GetService("Chat")
  3. local Conversating = false
  4. local ID = math.random(100000,300000000)
  5. local humanName = game.Players:GetNameFromUserIdAsync(ID)
  6. local follow = false
  7. local deathed = false
  8. local pathfindservice = game:GetService("PathfindingService")
  9. local path = pathfindservice:CreatePath()
  10.  
  11. local last = ""
  12.  
  13. local randomChats = {"What is this game","I need some admin or some scripts","Hey guys","Lets play lua wars instead its actually better than this game","anyone help me with something?","I dont know how to play","anybody knows how to play?","guys cart ride to super mario is fun","admin command pls","is flamingo in game?","script plz","free car insurance lol","this is goofy"}
  14. local conversationStart = {"hey bro","dude","can i have admin?","get back here!!!"}
  15. local con = {"wanna bee friends?","uh can you rank me on hd admin?","give admin now or ill follow more","im gonna get you!"}
  16.  
  17. function findCharacter(part)
  18.     local list = game.Workspace:children()
  19.     local torso = nil
  20.     local dist = 60
  21.     local temp = nil
  22.     local human = nil
  23.     local temp2 = nil
  24.     for x = 1, #list do
  25.         temp2 = list[x]
  26.         if (temp2.className == "Model") and (temp2 ~= script.Parent) and game.Players:GetPlayerFromCharacter(temp2) then
  27.             temp = temp2:findFirstChild("Torso")
  28.             human = temp2:findFirstChild("Humanoid")
  29.             if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  30.                 if (temp.Position - part).magnitude < dist then
  31.                     torso = temp
  32.                     dist = (temp.Position - part).magnitude
  33.                 end
  34.             end
  35.         end
  36.     end
  37.     return torso
  38. end
  39.  
  40.  
  41. function Humanoid(Name,FaceId)
  42.     local Body = Instance.new("Model")
  43.     Body.Name = Name
  44.     Body.Parent = game.Workspace
  45.     local human = Instance.new("Humanoid")
  46.     human.Name = "Humanoid"
  47.     human.Parent = Body
  48.     local humanoidrootpart = Instance.new("Part")
  49.     humanoidrootpart.Parent = Body
  50.     humanoidrootpart.Name = "HumanoidRootPart"
  51.     humanoidrootpart.Size = Vector3.new(2, 2, 1)
  52.     humanoidrootpart.Transparency = 1
  53.     local head = Instance.new("Part")
  54.     head.Size = Vector3.new(2,1,1)
  55.     head.Material = "Plastic"
  56.     head.Parent = Body
  57.     head.Name = "Head"
  58.     local face = Instance.new("Decal")
  59.     face.Texture = FaceId
  60.     face.Face = "Front"
  61.     face.Parent = head
  62.     local mesh = Instance.new("SpecialMesh")
  63.     mesh.MeshType = "Head"
  64.     mesh.Scale = Vector3.new(1.25,1.25,1.25)
  65.     mesh.Parent = head
  66.     local Torso = Instance.new("Part")
  67.     Torso.Parent = Body
  68.     Torso.Size = Vector3.new(2, 2, 1)
  69.     Torso.Name = "Torso"
  70.     local rootjoint = Instance.new("Motor6D")
  71.     rootjoint.Parent = humanoidrootpart
  72.     rootjoint.Part0 = humanoidrootpart
  73.     rootjoint.Part1 = Torso
  74.     rootjoint.C0 = CFrame.Angles(math.rad(-90),math.rad(180),0)*CFrame.new(0,0,0)
  75.     rootjoint.C1 = CFrame.Angles(math.rad(-90),math.rad(180),0)*CFrame.new(0,0,0)
  76.     rootjoint.Name = "RootJoint"
  77.     local neck = Instance.new("Motor6D")
  78.     neck.Part0 = Torso
  79.     neck.Part1 = head
  80.     neck.MaxVelocity = 0.1
  81.     neck.C0 = CFrame.Angles(math.rad(90),math.rad(180),0)*CFrame.new(0,-0,1)
  82.     neck.C1 = CFrame.Angles(math.rad(90),math.rad(180),0)*CFrame.new(0,0,-0.5)
  83.     neck.Parent = Torso
  84.     neck.Name = "Neck"
  85.     local Rigtie = Instance.new("Part")
  86.     Rigtie.Name = "Right Arm"
  87.     Rigtie.Parent = Body
  88.     Rigtie.Size = Vector3.new(1, 2, 1)
  89.     local rightieshold = Instance.new("Motor6D")
  90.     rightieshold.Parent = Torso
  91.     rightieshold.Part0 = Torso
  92.     rightieshold.Part1 = Rigtie
  93.     rightieshold.C0 = CFrame.Angles(math.rad(0),math.rad(90),0)*CFrame.new(0, 0.5, -1)
  94.     rightieshold.C1 = CFrame.Angles(math.rad(0),math.rad(90),0)*CFrame.new(0,0.5,-2.5)
  95.     rightieshold.Name = "Right Shoulder"
  96.     local left = Instance.new("Part")
  97.     left.Name = "Left Arm"
  98.     left.Parent = Body
  99.     left.Size = Vector3.new(1,2,1)
  100.     local motorleft = Instance.new("Motor6D")
  101.     motorleft.Parent = Torso
  102.     motorleft.Part0 = Torso
  103.     motorleft.Part1 = left
  104.     motorleft.C0 = CFrame.Angles(math.rad(0),math.rad(-90),0)*CFrame.new(0, 0.5, -1)
  105.     motorleft.C1 = CFrame.Angles(math.rad(0),math.rad(-90),0)*CFrame.new(-0, 0.5, -2.5)
  106.     motorleft.Name = "Left Shoulder"
  107.     local lleg = Instance.new("Part")
  108.     lleg.Name = "Left Leg"
  109.     lleg.Parent = Body
  110.     lleg.Size = Vector3.new(1,2,1)
  111.     local motorlleg = Instance.new("Motor6D")
  112.     motorlleg.Parent = Torso
  113.     motorlleg.Part0 = Torso
  114.     motorlleg.Part1 = lleg
  115.     motorlleg.C0 = CFrame.Angles(math.rad(0),math.rad(-90),0)*CFrame.new(0, -1, -1)
  116.     motorlleg.C1 = CFrame.Angles(math.rad(0),math.rad(-90),0)*CFrame.new(0, 1, -1.5)
  117.     motorlleg.Name = "Left Hip"
  118.     local rleg = Instance.new("Part")
  119.     rleg.Name = "Right Leg"
  120.     rleg.Parent = Body
  121.     rleg.Size = Vector3.new(1,2,1)
  122.     local motorrleg = Instance.new("Motor6D")
  123.     motorrleg.Parent = Torso
  124.     motorrleg.Part0 = Torso
  125.     motorrleg.Part1 = rleg
  126.     motorrleg.C0 = CFrame.Angles(math.rad(0),math.rad(90),0)*CFrame.new(-0, -1, -1)
  127.     motorrleg.C1 = CFrame.Angles(math.rad(0),math.rad(90),0)*CFrame.new(-0, 1, -1.5)
  128.     motorrleg.Name = "Right Hip"
  129.     local ff = Instance.new("ForceField")
  130.     ff.Parent = Body
  131.     debris:AddItem(ff,5)
  132. end
  133.  
  134. Humanoid(humanName,"rbxasset://textures/face.png")
  135. local Rig = game.Workspace:FindFirstChild(humanName)
  136. Rig:WaitForChild("HumanoidRootPart").CFrame *= CFrame.new(0,5,0)
  137.  
  138. Rig.Humanoid:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(ID))
  139.  
  140.  
  141. function chatRandom()
  142.     local r = randomChats[math.random(1, #randomChats)]
  143.     if not(r == last) and not deathed and not Conversating then
  144.         delay(math.random(15,25), function() -- 1 second delay
  145.             CS:Chat(Rig.Head, r, Enum.ChatColor.White)
  146.             last = r
  147.             chatRandom()
  148.         end)
  149.     end
  150. end
  151.  
  152. chatRandom()
  153.  
  154. local walking = false
  155. local walkD = false
  156.  
  157. local walkanimid = "http://www.roblox.com/asset/?id=180426354"
  158. local jumpanimid = "http://www.roblox.com/asset/?id=125750702"
  159.  
  160. local animationwalk = Instance.new("Animation")
  161. local animationJump = Instance.new("Animation")
  162. if not script:FindFirstChild("walkAnim") then
  163.     animationwalk.AnimationId = walkanimid
  164.     animationwalk.Parent = script
  165.     animationwalk.Name = "walkAnim"
  166.     animationJump.AnimationId = jumpanimid
  167.     animationJump.Parent = script
  168.     animationJump.Name = "jumpAnim"
  169. end
  170. Rig.Humanoid.Running:Connect(function(s)
  171.     if s > 0.01 then
  172.         walking = true
  173.     else
  174.         walking = false
  175.     end
  176. end)
  177.  
  178. local walkanimP = Rig.Humanoid:LoadAnimation(script.walkAnim)
  179.  
  180. game:GetService("RunService").Heartbeat:Connect(function()
  181.     if walking and not walkD then
  182.         walkanimP:Play()
  183.         walkD = true
  184.     else
  185.         if not walking then
  186.             walkanimP:Stop()
  187.             walkD = false
  188.         end
  189.     end
  190. end)
  191.  
  192. Rig.Humanoid.Died:Connect(function()
  193.     deathed = true
  194.     wait(3)
  195.     Rig:Destroy()
  196.     local clone = script:Clone()
  197.     clone.Parent = workspace
  198.     script:Destroy()
  199. end)
  200.  
  201. Rig.Humanoid.Jumping:Connect(function()
  202.     Rig.Humanoid:LoadAnimation(animationJump):Play()
  203. end)
  204.  
  205. function askSomeone()
  206.     Conversating = true
  207.     follow = true
  208.     local r = conversationStart[math.random(1, #conversationStart)]
  209.     CS:Chat(Rig.Head, r, Enum.ChatColor.White)
  210.     last = r
  211.     local target = findCharacter(Rig.Head.Position)
  212.     Rig.Humanoid.Jump = true
  213.     if target then
  214.         local Indicator = findCharacter(Rig.HumanoidRootPart.Position)
  215.         wait()
  216.         target = findCharacter(Rig.HumanoidRootPart.Position)
  217.         local hr = Rig:FindFirstChild("Humanoid")
  218.         while wait() do
  219.             if target ~= nil and (Rig.HumanoidRootPart.Position-target.Position).Magnitude > 10 then
  220.                 path:ComputeAsync(Rig.HumanoidRootPart.Position, target.Position)
  221.                 for _, waypoint in pairs(path:GetWaypoints()) do
  222.                     hr:MoveTo(waypoint.Position)
  223.                     print("walking to target: ".. (Indicator.Position - Rig.Head.Position).Magnitude)
  224.                     hr.MoveToFinished:Wait()
  225.                 end
  226.             else
  227.                 print("Broke: ".. (Indicator.Position - Rig.Head.Position).Magnitude)
  228.                 break
  229.             end
  230.         end
  231.         wait(0.1)
  232.         Rig.Humanoid.WalkSpeed = 0
  233.         print("Near")
  234.         Rig.Humanoid.Jump = true
  235.     end
  236.     if r == conversationStart[1] then
  237.         CS:Chat(Rig.Head, con[1], Enum.ChatColor.White)
  238.     end
  239.     if r == conversationStart[2] then
  240.         CS:Chat(Rig.Head, con[2], Enum.ChatColor.White)
  241.     end
  242.     if r == conversationStart[3] then
  243.         CS:Chat(Rig.Head, con[3], Enum.ChatColor.White)
  244.     end
  245.     if r == conversationStart[4] then
  246.         CS:Chat(Rig.Head, con[4], Enum.ChatColor.White)
  247.     end
  248.     wait(6)
  249.     Rig.Humanoid:MoveTo(Rig.Torso.Position)
  250.     Rig.Humanoid.WalkSpeed = 16
  251.     Conversating = false
  252.     follow = false
  253. end
  254.  
  255. while wait() do
  256.     local pos = Rig.HumanoidRootPart.Position
  257.     wait(10)
  258.     for i=1, math.random(2,5) do
  259.         Rig.Humanoid:MoveTo(Vector3.new(math.random(pos.X - 10,pos.X + 10),0,math.random(pos.Z - 10,pos.Z + 10)))
  260.         wait(math.random(10,18))
  261.     end
  262.     wait(1)
  263.     askSomeone()
  264. end
Advertisement
Add Comment
Please, Sign In to add comment