Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago
01game.Players.ChildAdded:connect(function(player)
02player.Chatted:connect(function(chat)
03if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then
04    if string.lower(chat) == "SF" then
05if not game.Workspace:FindFirstChild("Thing") then
06game.Lighting.Thing:Clone().Parent = game.Workspace
07end
08elseif string.lower(chat) == "close/gf" then
09if game.Workspace:FindFirstChild("Thing") then
10game.Workspace.Thing:Remove()
11end
12end
13end
14end)
15end)

Thats what I have so far so can you tell me what I did wrong?

1 answer

Log in to vote
0
Answered by
wrenzh 65
10 years ago

For the benefit of people who try to help you in the future, here is what you posted originally, correctly formatted with tags:

01game.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()
10                    end
11                end
12            end
13        end
14    end)
15end)

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!

0
You helped a little bit but when said that config had to be declared I have trouble understanding what you mean Ex_plore 62 — 10y
0
Where is your configuration folder? wrenzh 65 — 10y
0
Inside the script Ex_plore 62 — 10y
0
What is it called? wrenzh 65 — 10y
View all comments (2 more)
0
Configuration Ex_plore 62 — 10y
0
Then above the first line, write config = script.Configuration wrenzh 65 — 10y
Ad

Answer this question