Firstly, you shouldn't be defining your variables like that. Secondly, game.Workspace:FindFIrstChild("Humanoid") is not going to give you a player. If you gave it a second argument set to true, it'd look through everything within everything for a humanoid, but that's your player's character's humanoid - not the player.
You also don't check strings in that way. In addition, you should probably debounce so that you cant keep opening it when it's already opening.
What you want to do is have an event listener waiting for a player to join, and then waiting for that player to speak, then looping through a table of names to see if it returns true:
01 | admins = { "FlyScript" , "koolkid8099" , "Player" , "etc" } |
02 | door = game.Workspace.LobbyDoor |
05 | function nameCheck(name) |
07 | for _, v in pairs (admins) do |
15 | game.Players.PlayerAdded:connect( function (player) |
16 | player.Chatted:connect( function (m) |
17 | if nameCheck(player.Name) and m = = "open/lobby" and status = = "closed" then |
19 | door.BodyPosition.position = game.Workspace.EndLob.Position |
20 | door.CanCollide = false |
22 | door.CanCollide = true |
You'd do a similar sort of thing for closing the door.