Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I am making a Holo Training Place and I need some help,anyone correct me?

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?

1 answer

✓ Accepted answer

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!

6 comments

0

You helped a little bit but when said that config had to be declared I have trouble understanding what you mean

0

Where is your configuration folder?

0

Inside the script

0

What is it called?

0

Configuration

0

Then above the first line, write config = script.Configuration

This discussion is preserved as it was. New answers, comments, and votes are closed.