For the benefit of people who try to help you in the future, here is what you posted originally, correctly formatted with tags:
01 | game.Players.ChildAdded:connect( function (player) |
02 | player.Chatted:connect( function (chat) |
03 | if player:GetRankInGroup(config.GroupId.Value) > = config.RankId.Value then |
04 | if string.lower(chat) = = "SF" then |
05 | if not game.Workspace:FindFirstChild( "Thing" ) then |
06 | game.Lighting.Thing:clone().Parent = game.Workspace |
07 | elseif string.lower(chat) = = "close/gf" then |
08 | if game.Workspace:FindFirstChild( "Thing" ) then |
09 | game.Workspace.Thing:Remove() |
Anyway, answering your question:
Has config
been declared before the snippet of code you posted for us?
Also, you use string.lower(chat)
on line 4 but then you compare it to an uppercase value. That will never be true.
There may be more, but fix these things first, then try to debug a bit yourself, too. Use breakpoints, and the output.
Hope I helped!