Opening and unlocking door

A friend of mine told me he used this script and it works super well but things don’t look right on mine can someone help me fix it up a bit.
local players = game:GetService(“Players”)

local groupID = 6783107
local staffRank = 11+
function handlePlayer(player)
player.Chatted:Connect(function(msg)
print(player.Name…" has said something.“)
if (player:GetRankInGroup(groupID) >= staffRank) then
print(player.Name…” is a group admin.“)
msg = msg:lower() – Convert to lowercase
if (msg == “!unlockdoor”) then
print(“door unlock”)
1
elseif (msg == “!lockdoor”) then
print(“door lock”)
1
end
end
end)
end
for _, player in ipairs(players:GetPlayers()) do
print(player.Name…” was already in the game when the script started.")
handlePlayer(player)
end

players.PlayerAdded:Connect(function(player)
print(player.Name…" joined the game.")
handlePlayer(player)
end)

Problems:

  1. local staffRank = 11+ should be local staffRank = 11
  2. You have two lines where all that is written is “1.” That’ll break the script.
  3. There is nothing in the script which actually does anything to some sort of “door” or whatever.

Two things;

  1. Please use code blocks when posting code. Here is a topic that tells you how. :slight_smile:
  2. Please properly indent your code to make it readable.