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

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

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?

5 comments

0

Magnitude.

0

?

0

how would i do that?

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

0

UpperTorso, R15

1 answer

✓ Accepted answer

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 ;)

4 comments

0

this does not seem to work because the can collide is set to false, it cant collide with the player

0

then make it thinner and set can collide to true

0

it works. my mistake

0

no worries

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