Teaching a 9 y/o how to script and I am having trouble atm :P Seems right to me. I am making a door where only certain people can go through it. I can go through it no matter what though. It does not kill me either.
Admins = {"Player", "PreyStar"}
script.Parent.Touched:connect(function(hit)
if hit.Parent.Name == (Admins[1]) or (Admins[2]) or (Admins[3]) or (Admins[4]) then
script.Parent.CanCollide = false
wait(1)
script.Parent.CanCollide = true
print (hit.Parent.Name)
end
if hit.Parent.Name ~= (Admins[1]) or (Admins[2]) or (Admins[3]) or (Admins[4]) then
hit.Parent:BreakJoints()
end
end)

3 comments
How could I write this in a dictionary form? Thanks for the help.
Look at the wiki link. It would be something like: admins = { ["Perci1"] = true } ... if admins[hit.Parent.Name]
The script is not working right. Even though my name is in the table, I am able to go through it but later kills me.