I need to know how I can get my NPCs to see if they are touching the objective building in my game. I attempted a script that looks like this
Building = game.Workspace.BlueBuilding1
model = script.Parent
model.PrimaryPart.Touched:Connect(function(hit)
if hit.Parent.Name == "BlueBuilding1" then
print("got it")
Building.Strength = Building.Strength - 100
script.Parent.Humanoid.Health = 0
end
end
but it doesn't seem to be working.

2 comments
I'm not too sure but if the primarypart is the humanoidrootpart and such, would that detect collisions?
Idk if this is the problem but you forgot to close the parenthesis. The last end should say end) instead.