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

How can I make a monster that moves when your not looking at it? [closed]

Asked by
h5148 -93
5 years ago

I have tried to look at many scripts regarding this but can't understand it. Please comment a script for this.

0
This is not a request site. DeceptiveCaster 3761 — 5y

Closed as Not Constructive by DeceptiveCaster, namespace25, and zblox164

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

there are many ways to do this as making npcs are a multi step process. but because this isnt a request site I will only give you a basic concept to get you started.

first: to give your monster visual site, you can use raycasting, gettouchingparts, or a script with a touch function.

second: you will want an indicator to whether your player is looking at the monster or not. insert a part in front of your player, using this part you can cast a ray in front of you using raycasting. or you can stretch it out. after stretching it out in front of you your left with basically a pole in front of you. this will represent your players visual range and then you can use either GetTouchingParts or a touch function when the part collides with the monster. after that just code the monster so it reacts when said visual part collides with it or not. you can make the visual part fully transparent to make it look good. that all I can give you but it should get you started.

0
Thank you but i dont know how to use raycasting. Can you teach me that please? h5148 -93 — 5y
0
https://devforum.roblox.com/t/raycasting-how-do-i-do-it/186446/2 the third comment down on this page helped me understand how to use raycasting and I think it will help you too. mantorok4866 201 — 5y
0
Thanks ill try it h5148 -93 — 5y
0
@mantorok4866 How do I insert a part in front of the players head using script? h5148 -93 — 5y
0
Can u friend me on roblox i cant figure this out h5148 -93 — 5y
Ad