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

How to make a character Detect when infront of NPC script?

Asked by 5 years ago

i am currently making a copy of Notoriety guard, and all i need left is realism, i made a hat with par that when touched by player hes detected with mask on, but the problem is that you can do that THROUGH walls, and the NPC's MOVE, so if they face a wall with person with mask on other side, they are detected, which doesn't happen in real life or Notoriety! i was thinking this script:

if see player connect
if player.Masked.Value == true then
if hat touched by something else too then not detected
if person is only thing touched by hat (sight) then detected

the problem with that is if there is a prt like for example NEXT to the player not infront of it, then player doesnt get detected, which doesnt make sense, so how can i do this? remember, i want a script that senses a player in front (i already did using an accesory with Handle with attachment in front of NPC) also detecting if that masked player is BEHIND SOMETHING or not. please help, thanks :)

1 answer

Log in to vote
0
Answered by 5 years ago

hello, iv been looking for questions to answer and this is a good one, remember me? i answered some of your previous questions :) anyways, so how about the script make it so it also detects if there is a part in front of HIM, just copy the accesory inside NPC and put it in player, u can use remote event which i KNOW u know how, or you can put in that script to find that players sight sccesory and see if its touched, hope this helps :)

0
omg THANKS SO MUCH ill try right NOW CommanderCaubunsia 126 — 5y
0
wait CommanderCaubunsia 126 — 5y
0
what if that player (the chaacter actualy) is facing backwards to the NPC, and the player's sight acceory touches a wall fro example, then he wont get detected even if hes right in front of NPC, so how do i do this? CommanderCaubunsia 126 — 5y
0
ig players sight accesory touching NPC (sees if anything is infront of player, since players looking at NPC, both models must be looking at same part if there is one between them both) then if players accesory touches something else then not detected idunnobut 27 — 5y
View all comments (3 more)
0
make another accesory for back of player, if that touched NPC, (so now you know wherer NPC should look) then if player's BACK accesory fro sight touches something then not detected, else detected, same for other sides, wow it took me so long to thing of that idunnobut 27 — 5y
0
hm ok ill try that out... may take a long time... CommanderCaubunsia 126 — 5y
0
i dont understand like how i do that though, i need to know if player sight touched is NPC? i cnat do if player.sight.handle.touched(c) then it no work, how do i detect a player touching NPC with NPC script? CommanderCaubunsia 126 — 5y
Ad

Answer this question