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
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

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:

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!

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