I've tried making a door which only lets certain people through it, this is what I have so far.
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Character = hit.Parent
local Player = game.Players:GetPlayerFromCharacter(Character)
if Player.Name == {"Zeluxis","CallumStoneUK","MattBaker179"} then
script.Parent.CanCollide = false
wait(1)
script.Parent.CanCollide = true
end
end
end)
For some reason it wont work at all, and I'm really confused.
Thanks.

1 comment
You would be better off using collision groups, https://blog.roblox.com/2017/05/introducing-collision-groups/