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.
You didn't specify what part of the table you want to access. You need to specify every variable specifically.
local playersallowed = {"Zeluxis","CallumStoneUK","MattBaker179"} local allowed = false for i, v in pairs(playersallowed) do if Player.Name == v then allowed = true break end end --have a checker if allowed is true.