NPC killer how to make?

I want to create an NPC killer who will search for players by location and catch up with them and kill them, but I’ve never worked with an NPC and I don’t know how to make a random walk around the house or a three-way NPC, I would like him to be able to open doors made by me on TweenService, I don’t know where to start and how to help please with this.

1 Like

You can just use a regular dummy roblox character for this.

local PlayerName = workspace:FindFirstChild('Kryptoscythe')
local HRP = Dummy.Humanoid

-- Make a random event that triggers the rest of this code

HRP:Move(PlayerName.HumanoidRootPart)

To kill, you can do something like this (Here’s the pseudo code for this one)

-- If the distance between NPC and player is less than whatever distance you wanted it to be then

-- Probably make a loop, damaging the player until the player dies.

-- Break the loop when the player walks farther enough

if (HumanoidRootPart.Position - NPC.HumanoidRootPart.Position).Magnitude <= 10 then

-- Something like that ^^. Probably make it constant by detecting whenever the player moves and abstract it to a variable and then break the loop where the player loses damage when the distance between both NPC and player is more than it should be.
4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.