Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can you make an NPC open doors?

I want to make an AI on my own and I want to know how can I make them open doors. I dont know much about scripting, so how do you make an NPC wonder around, jump over blocks, and open doors?

3 comments

1

you could have a block in front of npc and when the npc touches it the door slides open

0

How though?

0

Well where is the NPC trying to go to?

1 answer

✓ Accepted answer

If the door opens by touch, you can make every door CanCollide false on the server, and then in LocalScripts make them CanCollide true for all players. Then, pathfinding service should automatically find its way through the doors, still making them open on touch. Otherwise, if they opened by click, you could make a ModuleScript with the code to open the door. Then, every time the NPC is moved, you could create a Region3 around it to check for adjacent doors, and then require the module to open the door.

6 comments

0

This is correct ????

0

Yea, I guess that helps? Can I make a door animation of some sort?

0

yes

0

Your telling me what scripts I need to use but not how to use them -_-

0

Thanks anyways!

0

TYY!!

This discussion is preserved as it was. New answers, comments, and votes are closed.