Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can you make an NPC open doors?

Asked by
clrik 8
6 years ago

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?

1
you could have a block in front of npc and when the npc touches it the door slides open TheGreatSailor 20 — 6y
0
How though? clrik 8 — 6y
0
Well where is the NPC trying to go to? Au_Naturel -26 — 4y

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

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.

0
This is correct ???? xDestinoYT 2 — 6y
0
Yea, I guess that helps? Can I make a door animation of some sort? clrik 8 — 6y
0
yes Prbo1201 56 — 6y
0
Your telling me what scripts I need to use but not how to use them -_- clrik 8 — 6y
View all comments (2 more)
0
Thanks anyways! clrik 8 — 6y
0
TYY!! ninjanerd601 9 — 2y
Ad

Answer this question