Hello everyone! I am looking for someone just to send me some pointers on how to script an AI dog, controlled by a GUI menu to go looking for a specific person in general. If anyone has previous experience doing this and can just let me know some resources on how to script it or just tell me some scripting pointers to get started, please! Thank you for looking, have a nice evening/moring.
I would look at Remote Events and Watch this Tutorial by “Gamer M8”
The Roblox Creator Documentation is a really useful place!
Well, If you have a textbox that players can enter a players name into and then press a ui button to “Enter it” you could take the players name and send it over a remotefunction in this case lets call it PlayerDogAi, that would look like this:
--localscript in enter button
local playername = script.Parent.Parent.PlayerNameTextBoxHere
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.PlayerDogAi:FireServer(playername)
end)
that would be put in the enter button, now for the server. I will be defining it as “dog” in this.
-- put in a script in serverscript
game.ReplicatedStorage.PlayerDogAi.OnServerEvent:Connect(function(plr,playername)
local dog = workspace.Dog
local playertarget = workspace:FindFirstChild(playername)
dog.Humanoid:MoveTo(playertarget.HumanoidRootPart)
end)
This should work, if it does not please let me know!
You could first try out Roblox’s pathfinding.
When that is finished, you will probably need to implement your own pathfinding service.