RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a script that the player will be a NPC that walks and talks"
-- server script local Players = game:GetService("Players") local NPCs = game:GetService("NonPlayerCharacters") Players.PlayerAdded:Connect(function(player) local npc = NPCs:LoadCharacter(player.UserId) npc.Parent = game.Workspace local humanoid = npc:WaitForChild("Humanoid") humanoid.WalkSpeed = 16 local path = game:GetService("PathfindingService"):CreatePath() path:ComputeAsync(humanoid.RootPart.Position, Vector3.new(0, 0, 0)) for _, waypoint in pairs(path:GetWaypoints()) do humanoid:MoveTo(waypoint.Position) humanoid.MoveToFinished:Wait() end local dialogue = Instance.new("Dialog") dialogue.Text = "Hello, I'm an NPC!" dialogue.Parent = npc dialogue:Say() end)