I want to make a script where when a part is being touched, the player is hidden from NPC's until they are no longer touching the part. I also need the PathFinding script to reset when the brick is being touched. (The Pathfinder script was deleted because it was glitched on the R15 avatar)

(The part is the Brick)

I only know how I can make a OnTouched script.


local torso = game.Players.zboi082007.Torso -- I dont really know how do do this part --
local bandit = game.ReplicatedStorage.Bandit
local path = bandit.path

script.Parent.Touched:Connect(function()
	bandit.path = ??? -- neither this ---

4 comments

0

Also, I need to say that I have random scripts half English and half Japanese in my game.

0

Okay - don't rely on Touched for this it is a bad idea. Use raycasting instead. A single ray existing for the purpose of detecting whether or not the player is touching some object is very inexpensive and a step up from the Touched event.

0

Well how would I make the script?