Jukeable NPCs (Scripting NPC)

Hello, I’m LuaGirlDeveloper and I’m trying to make a Juke able NPC that you can juke you dodge the NPC like Foxy from FNAF Doom.

Video:
Uploading: Roblox 2025-07-24 16-03-02.mp4…

2 Likes

you should probably reupload the video, i think its bugged

Okay, I’ll reupload. Thank you for reminding me and pointing that out.

Here’s the video I’m talking about.

Video:

if you already made a script that determines the ability an npc is going to do, i think the easiest way of making the npc jukeable is by just adding end lag to an attack.

edit: At the start of an attack you should probably include some windup through animations to allow the player to dodge.

Can I give you my script and can you teach me?

@InactiveVan2 I have one question but how will I detect when you juke because I want to play a slide animation.

I cant really teach you because im not that good myself, however the jukeing mechanic is solely in the npcs abilities so once you create an ability your able to add animations before and after the attack, essentially if at the start of an ability you play an animation the player is able to slide out of the way, after the ability is done you can add a endlag timer of your choice.

also can u explain what you mean by you want to play a slide animation, is this for the player or the npc?

So, when the NPC is chasing you and you turn fast or like juke out then the NPC will play an animation. I don’t know how to achieve that.

Make it so when they attack, add a linear velocity in the direction they are moving and after set amount of time, make them attempt to do damage.

Oh so for that you could make hitbox, weld it to the npc, when the npc tries to attack you if the hitbox doesn’t detect any player was hit then you can make the npc play an animation, i think this is what your trying to achieve.

Yea but I want to be able to juke when he’s chasing and attacking. So maybe I can get the player location then when the NPC hit the player location if the player is to the side or moved to the side then I could play the slide animation

I don’t really know to be honest I’ve been coding for years but I never tried to make something like this.

Yea this is pretty interesting im not really sure how you would go about doing this, someone else will probably reply who knows how to do this.

Yea that’s a good idea, but I can’t really code that because I don’t really code NPCs I only code guns, tools, swords, doors act.

1 Like

Having an understanding of coding and to be a coder means to be a problem-solver. Your mindset is flawed. Have some confidence in yourself and set out to understand the fundamentals of what you’re doing rather than trying to simply achieve a result.

5 Likes

(1) npc gets the location of the player
(2) npc spends time by squatting beforre jumping
(3) npc jumps toward the location the player during (1)

best ways to move the npc for step 3 jump:
BodyVelocity
LinearVelocity
Tween

if ur a noob that wants to do it easily, put an invisible part where the player is during (1) and do alighposition to move the npc toward it. I dont reccomend it and idk how good it’ll look.

1 Like

coding is problem solving, if you dont try to think/search the internet for solutions the game will be a mess of unoptimized templates that dont fit together. if you can code guns, tools, etc. you should be able to code this, or be able to search for solutions instead of asking devforum for a solution that may or may not be good

2 Likes

For me I’ll probably use a Velocity and an Animation to make that. Thank you for the ways I could do that.

Another thing is how can I do that with the other NPCs like that don’t lunge at the player? Like in the game they just kind slide or drift where the player would be?