So far this is what I have,I already have a Configuration file but I dont know whats wrong
game.Players.ChildAdded:connect(function(player)
player.Chatted:connect(function(chat)
if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then
if string.lower(chat) == "sf" then
if not game.Workspace:FindFirstChild("Thing") then
game.Lighting.Thing:Clone().Parent = game.Workspace
end
elseif string.lower(chat) == "close sf" then
if game.Workspace:FindFirstChild("Thing") then
game.Workspace.Thing:Remove()
end
end
end
end)
end)

5 comments
You helped a bit but what do you mean check if they are an admin?
If they have administrative powers, aka the ability to use the chat commands. " if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then"
Checking once as soon as they enter the game will help decease lag instead of checking every time they chat.
But I tried it and it didnt work for me
Both ways work, but mine is more efficient. If the script does not work it is another problem. Any output?