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

How do I make it so if a npc collides with a wall, they can walk through it?

Asked by 8 years ago

This isn't a CanCollide Properties setting, this is where if a npc/model (like a zombie) collides with a wall, that they can walk through it, but a player can't. I couldn't think of anything and does someone have a solution?

0
You could just make a wall, then add a script into it that makes them teleport to the other side only for specific npcs. Anthony9960 210 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago
wallpart.Touched:connect(function(h)
    isnpc = h.Parent:FindFirstChild('Humanoid')
    if isncp ~= nil and h.Parent.Name = "npc name"
        wallpart.CanCollide = false
        wait(2)
        wallpart.CanCollide = true
    end
end)
0
this script only allows it to find players in the game, not npcs CardboardedCharacter 53 — 8y
0
He is assuming that if it isn't a player, then it must to be an NPC davness 376 — 8y
Ad

Answer this question