Making a player-only interactable part

Hey, I’m trying to get a workaround to prevent NPCs from getting to places they shouldn’t be.

Context

At first, I thought of proximity prompts but then it wouldn’t feel right, since the point is to touch a part and make it seem like you fell through the floor or phased through the wall. When I went back to the touch method, I tried adding a certain object inside a player to detect if they’re an NPC or not and that needed the whole code of the NPCs to be rewritten so I didn’t do that because I’m lazy. Eventually…

I came across an old Devforum thread I stole borrowed code from to try. It consisted of a LocalScript in StarterPlayerScripts with only this:

local tPart = game.Workspace.Map.gm_flatgrass.BackroomsTP.MapTP

tPart.CanCollide = true
tPart.CanQuery = true
tPart.CanTouch = true

well, obviously it wasn’t this, I just modified it to suit my needs.
The plan was to make it only interactable with players locally, so NPCs handled by the server could not interact with this by setting the properties the script sets to true to false in the workspace.

This didn’t end up working at all and I’m starting to get a little bit irritated, I tried using collision groups but to nobody’s surprise I’m not experienced in that field enough to know how to implement it for such a specific case.

Any advice or help is appreciated. Thank you in advance

assuming by “interactable” you just mean “can touch”.

if you’re using pathfinding there’s material costs and pathfindingmodifier.
more stuff here

other than that i’d just do collision groups like you said.