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/gf" then if game.Workspace:FindFirstChild("Thing") then game.Workspace.Thing:Remove() end end end end) end)
Thats what I have so far so can you tell me what I did wrong?
For the benefit of people who try to help you in the future, here is what you posted originally, correctly formatted with tags:
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 elseif string.lower(chat) == "close/gf" then if game.Workspace:FindFirstChild("Thing") then game.Workspace.Thing:Remove() end end end end end) end)
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!