So,
I have the script
Regular Script:
script.Parent.Touched:Connect(function(part)
print("a")
if part.Parent:FindFirstChild("Humanoid") then
print("b")
local char = part.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
print(plr.Name)
if plr:GetRankInGroup(2810845) > 5 then
print("c")
script.Parent.CanCollide = false
end
end
end)
How do I make it so only the player who is allowed can walk trough? How to make the change local instead of global? Changing to local script does not work.

5 comments
You could just use collisionGroups
you could use a remote event
Pedro another thing you could do is use a remoteevent and fireclient() to make the player do the change locally, as touched doesn't work from a local script.
This would be much easier to accomplish with local parts, since there would be a different part for each player. This would allow you to change the properties of that part so it only impacts certain players.
That's what I'm suggesting by using the remoteevent. Collisiongroups aren't difficult and are MUCH easier if you know how to use them, but you can't use Touched from a local script so you'd need remoteevents to tell the client to make it non collidable