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

(HELP!!!) a part that checks if a player is near a npc?

Asked by 4 years ago
Edited 4 years ago

so. I have done this before, but when I changed to r15, it did not work anymore. I need a script or a way to make a part with a script that checks if a player actually goes near the NPC. I have the same example of another NPC and my original works on that one, so why does it not work on the new one? I tried it but the NPC just bounced away! how do I fix/do this?

0
Magnitude. greatneil80 2647 — 4y
0
? codingMASTER398 52 — 4y
0
how would i do that? codingMASTER398 52 — 4y
0
what part of the player are you checking the difference in distance between? the torso? id suggest checking the distance using the player's head or humanoidrootpart as these two parts are the same between the rigtypes R6 and R15 SerpentineKing 3885 — 4y
0
UpperTorso, R15 codingMASTER398 52 — 4y

1 answer

Log in to vote
1
Answered by
seikkatsu 110
4 years ago
Edited 4 years ago

you could try putting a part with transparency 1 and can collide false and script it so when the player touches it a certain script runs. You could do this by firing an event called "touched event" . Let me know if you need more help. (and also after you made it please accept my answer so i can ger that sweet reputation ;)

0
this does not seem to work because the can collide is set to false, it cant collide with the player codingMASTER398 52 — 4y
0
then make it thinner and set can collide to true seikkatsu 110 — 4y
0
it works. my mistake codingMASTER398 52 — 4y
0
no worries seikkatsu 110 — 4y
Ad

Answer this question