Roblox Smart NPCs: Code Characters That Follow and Patrol

Roblox Smart NPCs: Code Characters That Follow and Patrol

Roblox Smart NPCs: Code Characters That Follow and Patrol

An eight-week course on game AI in Roblox Studio. Learners code non-player characters that follow players, patrol routes, notice nearby players and react with simple decision rules.

Roblox Smart NPCs: Code Characters That Follow and Patrol

Paid once.

Level
Intermediate
Ages
9–13
Duration
55 min
Classes
1 / Week
Weeks
8

Class Experience

The characters that walk, guard and chase in games are powered by game AI, a set of rules that decide what a character does next. In this eight-week course learners code their own smart non-player characters in Roblox Studio and learn how game AI really works.

Learners begin by exploring the difference between game AI, which follows rules written by developers, and machine learning, which learns from data. They then build a simple character and script it to walk to a target point. Next they code a follower pet that stays close to the player and a guard that patrols between waypoints in a loop.

In the middle weeks learners add senses. They code characters that notice a player within a certain distance or line of sight, then switch behavior, such as a shopkeeper who waves or a guard who sounds an alarm. Learners use if-then rules to decide what each character does and test how small changes make characters feel smarter.

In the final weeks learners combine behaviors into a stealth or village scene where several NPCs act on their own, and they present how their rules work. The teacher explains each idea with diagrams and live coding.

By the end learners will understand rule-based game AI and have coded several smart characters. Basic Lua knowledge is recommended.

How classes work

Each class introduces one NPC behavior with a diagram and live coding. Learners add it to their characters and test how they react.

What we'll cover

  • Week 1: What Is Game AI – Compare rule-based game AI with machine learning.

  • Week 2: Walking to Targets – Script a character that walks to a point.

  • Week 3: Follower Pet – Code a pet that stays near the player.

  • Week 4: Patrolling Guard – Loop a guard through waypoints.

  • Week 5: Detecting Players – Notice players by distance.

  • Week 6: Line of Sight – Check whether a character can see the player.

  • Week 7: If-Then Behaviors – Switch behaviors with decision rules.

  • Week 8: Living Village Scene – Combine several NPCs and present their rules.

Learning Outcomes

  • Explain the difference between game AI and machine learning

  • Code NPCs that walk to targets and follow players

  • Script patrol routes with waypoints

  • Add detection by distance and line of sight

  • Combine if-then rules into smart behaviors

Prerequisites

Basic Lua knowledge such as variables, functions and events.

Available Times (0 available)

Loading available class times…

Meet your Instructor

Joined August, 2026

4.4

14

Reviews

10+

Years

450+

Students

With over ten years of experience teaching technology in classrooms and workshops, this educator brings a practical, hands-on approach to coding and digital creation. Holding a B.S. in Computer Science, this instructor has guided learners through block-based and text-based progra…

Reviews

Lua in 30: Bite-Size Roblox Scripting

Lua in 30: Bite-Size Roblox Scripting

Neha Singh

Ages 9–12 · 30 min · 1 / Week

$19.67per classSee schedule

1-on-1 Advanced Minecraft Modding: Custom Mobs and Items

1-on-1 Advanced Minecraft Modding: Custom Mobs and Items

Bharat Tandon, M.Ed

Ages 13–16 · 30 min · 1 / Week

$20.25per classSee schedule

1-on-1 Advanced Command Blocks and Datapacks

1-on-1 Advanced Command Blocks and Datapacks

Srishti Desai

Ages 12–15 · 30 min · 1 / Week

$20.17per classSee schedule

1-on-1 Minecraft Modding with Java

1-on-1 Minecraft Modding with Java

Bharat Tandon, M.Ed

Ages 12–16 · 30 min · 1 / Week

$20.25per classSee schedule

Roblox Survival Game 1-on-1: Build Your Own Survival World

Roblox Survival Game 1-on-1: Build Your Own Survival World

Shreya Reddy

Ages 9–14 · 55 min · 1 / Week

$20.25per classSee schedule

Roblox Racing Game 1-on-1: Personal Coding Coaching

Roblox Racing Game 1-on-1: Personal Coding Coaching

Vaishnavi Mukherjee

Ages 8–14 · 55 min · 1 / Week

$20.25per classSee schedule

Roblox Kart Racing Camp: Build and Code a Racing Game in a Week

Roblox Kart Racing Camp: Build and Code a Racing Game in a Week

Ishita Nair

Ages 8–12 · 55 min · 5 / Week

$19.60per classSee schedule

Roblox Roleplay School: Code Jobs, Schedules and Class Bells

Roblox Roleplay School: Code Jobs, Schedules and Class Bells

Srishti Desai

Ages 9–13 · 55 min · 1 / Week

$19.75per classSee schedule

Lua in 30: Bite-Size Roblox Scripting
NS

Neha Singh

Lua in 30: Bite-Size Roblox Scripting

Beginner

Level

9–12

Ages

30 min

Duration

1 / Week

Classes

6

Weeks

$19.67per class
See schedule
1-on-1 Advanced Minecraft Modding: Custom Mobs and Items
BT

Bharat Tandon, M.Ed

1-on-1 Advanced Minecraft Modding: Custom Mobs and Items

Advanced

Level

13–16

Ages

30 min

Duration

1 / Week

Classes

8

Weeks

$20.25per class
See schedule
1-on-1 Advanced Command Blocks and Datapacks
SD

Srishti Desai

1-on-1 Advanced Command Blocks and Datapacks

Advanced

Level

12–15

Ages

30 min

Duration

1 / Week

Classes

6

Weeks

$20.17per class
See schedule
1-on-1 Minecraft Modding with Java
BT

Bharat Tandon, M.Ed

1-on-1 Minecraft Modding with Java

Advanced

Level

12–16

Ages

30 min

Duration

1 / Week

Classes

8

Weeks

$20.25per class
See schedule
Roblox Survival Game 1-on-1: Build Your Own Survival World
SR

Shreya Reddy

Roblox Survival Game 1-on-1: Build Your Own Survival World

Mixed Level

Level

9–14

Ages

55 min

Duration

1 / Week

Classes

12

Weeks

$20.25per class
See schedule
Roblox Racing Game 1-on-1: Personal Coding Coaching
VM

Vaishnavi Mukherjee

Roblox Racing Game 1-on-1: Personal Coding Coaching

Mixed Level

Level

8–14

Ages

55 min

Duration

1 / Week

Classes

12

Weeks

$20.25per class
See schedule
Roblox Kart Racing Camp: Build and Code a Racing Game in a Week
IN

Ishita Nair

Roblox Kart Racing Camp: Build and Code a Racing Game in a Week

Beginner

Level

8–12

Ages

55 min

Duration

5 / Week

Classes

1

Weeks

$19.60per class
See schedule
Roblox Roleplay School: Code Jobs, Schedules and Class Bells
SD

Srishti Desai

Roblox Roleplay School: Code Jobs, Schedules and Class Bells

Beginner

Level

9–13

Ages

55 min

Duration

1 / Week

Classes

8

Weeks

$19.75per class
See schedule