local group = {
["jameswowsmile"] = true;
["leslielol1234"] = true;
}
game.Players.PlayerAdded:connect(function(player)
if group[player.Name] then
player.Chatted:connect(function(msg)
--chatted code
end)
end
end)
door = script.Parent --this is the door
function onChatted(msg, recipient, speaker)
-- convert to all lower case
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "FloorClose") then
door.CanCollide = false
door.Transparency = 1
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
This is supposed to give two players (Jameswowsmile and Leslielol1234) permission to say a command that would make a floor disappear when you say "FloorClose". I tested this and it didn't work. What did I do wrong?

1 comment
Thank you! It works! However, on the 9th line, you forgot a local. Works after you put it on!