hello there, i am trying to make a help command gui but i ran into some issues. I trying to get all the commands from the module script but i can get it to work. Its something like a playerlist but for commands.
Local Script:
local commandList = require(game.ReplicatedStorage.SettingsFolder.Settings)
local template = game.ReplicatedStorage.Template
local list = script.Parent.List
for i, commandList in pairs(commandList.Commands) do
local label = template:Clone()
label.Name = i
label.Position = UDim2.new(0.027, 0, i * template.Size.Y.Scale, 0)
label.Parent = list
end
while wait() do
for i, label in pairs(list:GetChildren()) do
if commandList.Commands[i] then
label.Text = commandList.Commands[i].Name
else
label.Text = ""
end
end
end
From what I see, your LocalScript is trying to get FacilityCommands from the command ModuleScript, while in your ModuleScript, Commands is the only thing close to FacilityCommands.
I think your problem is that you’re to get a list that doesn’t exist.
local commandList = require(game.ReplicatedStorage.SettingsFolder.Settings)
local template = game.ReplicatedStorage.Template
local list = script.Parent.List
for i, comands in pairs(commandList.Commands) do
print(comands)
local commandText = template:Clone()
commandText.Text = comands
commandText.Parent = list
end