I'm just wondering how can we make an "AI" go across a map, like a ghost.
When he sees you, he gets closer and closer.
Thanks for answering! :D
Wow, man, you're a very curious person! I'm answering all your questions, so feel free to ask more, xD!
Answered 2 already, xD! Here's how it works: We obtain the AI, we get the humanoid, we make the point where we want it to go, and we make it go there using MoveTo(position)
Step 1: Get the Point,AKA the place where the character walks to. Create a part in Workspace, name the part "Point" move the part wherever you want the AI to go.
Now let's get to work!
-- Regular script function AiMove() local Point = workspace.Point.Position local AI = workspace:FindFirstChild("Artificial intelligence") --[[ Put the name of the AI here, or name it to Artificial intelligence, either one works. --]] local human = AI.Humanoid human:MoveTo(Point) end
Now, this makes the AI move using a function, HOWEVER, we got to make the function activate now. Let's do this when the player joins, to make sure the ghost doesn't start moving when they're loading.
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(chara) AiMove() end) end)
Now, the AI will move when the character has been added.
Hope I helped, remember to ask for more help if you need it, tell me if it worked, or accept my answer! Good day =)