so I have an NPC made and I have put in a bool value the values name is IsNPC and it is false in players and true in NPCs and I want to make 1 part do something when a player touches and something when an NPC touches, I have made 2 scripts and it does what it needs to do when a player touches and in another script, I have put in some code but I don’t know how to separate NPCs and players when they touch the part here’s the code for when the NPC touches (it does not work)
local part = script.Parent
part.Touched:Connect(function(hit)
local parent = hit.Parent
local NPC = workspace.Walk
if NPC then
print("pls work pls i have been trying for so long")
end
end)
so I want to know, how can I make it only work when the NPC touches it and do nothing when a player touches?