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)