Value does not give any information

Hi devs! I added some information linked to the top of the script line, but the value does not give it to the text, just it has a number (Configuration: 2). Look at the red spot in the image that does not give value to the text:

Capture d’écran 2024-02-07 172937_reddraw

Look at the module script:

local engineInfo = {
	["Configurations"] = { -- The configurations, all numbers means whytes in any locomotives.
		[1] = "0-4-0",
		[2] = "0-6-0",
		[3] = "2-4-0",
		[4] = "2-4-2",
		[5] = "2-6-0",
		[6] = "2-6-2",
		[7] = "4-4-0",
		[8] = "4-4-2",
		[9] = "4-6-0",
		[10] = "4-6-2"
	}
}

function engineInfo.MakeEngineInfo(engine, name, engType, slocation, configuration, topSpeed)
	if engineInfo then
		local placeholder = Instance.new("Frame")
		placeholder.Name = name
		placeholder.BackgroundColor3 = Color3.new(0, 0, 0)
		placeholder.BackgroundTransparency = 0.5
		placeholder.BorderSizePixel = 0
		placeholder.Active = true
		
		local engineName = Instance.new("TextLabel")
		engineName.Name = "engineName"
		engineName.Size = UDim2.new(0.833, 0, 0.125, 0)
		engineName.Position = UDim2.new(0.083, 0, 0.58, 0)
		engineName.TextColor3 = Color3.new(1, 1, 1)
		engineName.BackgroundTransparency = 1
		engineName.Font = Enum.Font.SourceSans
		engineName.TextScaled = true
		engineName.Text = name
		
		local engineConfiguration = Instance.new("TextLabel") -- The Engine's configuration is assigned when it selects any configurations from the top of the script but as seen in the engine information script.
		engineConfiguration.Name = "engineConfiguration"
		engineConfiguration.Size = UDim2.new(0.833, 0, 0.05, 0)
		engineConfiguration.Position = UDim2.new(0.083, 0, 0.69, 0)
		engineConfiguration.TextColor3 = Color3.new(1, 1, 1)
		engineConfiguration.BackgroundTransparency = 1
		engineConfiguration.Font = Enum.Font.SourceSans
		engineConfiguration.TextScaled = true
		engineConfiguration.Text = "Configuration: " .. configuration

		
		local engineDisplay = Instance.new("ViewportFrame")
		engineDisplay.Name = "engineDisplay"
		engineDisplay.Size = UDim2.new(0.833, 0, 0.5, 0)
		engineDisplay.Position = UDim2.new(0.083, 0, 0.058, 0)
		engineDisplay.BackgroundColor3 = Color3.new(0, 0, 0)
		engineDisplay.BackgroundTransparency = 0.5
		engineDisplay.BorderSizePixel = 0
		
		local cameraDisplay = Instance.new("Camera")
		cameraDisplay.Name = "cameraDisplay"
		cameraDisplay.Parent = engineDisplay
		
		engineDisplay.CurrentCamera = cameraDisplay
		
		engine:Clone().Parent = cameraDisplay
		
		placeholder.Parent = engType
		engineName.Parent = placeholder
		engineConfiguration.Parent = placeholder
		engineDisplay.Parent = placeholder
		cameraDisplay.Parent = engineDisplay
		
		local spawnBtn = Instance.new("TextButton")
		spawnBtn.Name = "spawnBtn"
		spawnBtn.Size = UDim2.new(0.833, 0, 0.045, 0)
		spawnBtn.Position = UDim2.new(0.083, 0, 0.920, 0)
		spawnBtn.BackgroundColor3 = Color3.new(0.184314, 0.576471, 0.176471)
		spawnBtn.BorderSizePixel = 0
		spawnBtn.Font = Enum.Font.SourceSans
		spawnBtn.TextColor3 = Color3.new(1, 1, 1)
		spawnBtn.TextSize = 18
		spawnBtn.Text = "Spawn"
		
		spawnBtn.Parent = placeholder
		
		local debounce = false
		
		local replicatedStorage = game.ReplicatedStorage
		local spawnTrainEvent = replicatedStorage.SpawnTrainEvent
		
		local trainSpawnerGui = script.Parent.Parent
		
		spawnBtn.Activated:Connect(function()
			spawnTrainEvent:FireServer(engine, slocation)
			trainSpawnerGui:Destroy()
			wait(1)
			replicatedStorage.Reference.SpawnLocationSelected.Value = nil
		end)
		
		if not engine then
			error("Could not find " .. engine)
		end
	end
end

return engineInfo

Local script:

local p = script.Parent

local player = game.Players.LocalPlayer
local trainSpawnerGui = player.PlayerGui.TrainSpawnerGui

local replicatedStorage = game:GetService("ReplicatedStorage")

local thomas = replicatedStorage.TrainAssets.Locomotives.Steam:WaitForChild("Thomas")

local sLocation = workspace.spawnLocation
local sLocationSelected = workspace.spawnLocation.Test1

local locoListFrame = p.Parent.SteamLocoListFrame

local engineInfo = require(p.Parent.ModuleScript)

engineInfo.MakeEngineInfo(thomas, "Thomas", locoListFrame, sLocationSelected, 2)

How do I fix a problem where the value does not give any information? :thinking:

Well, in the script you are asking for an index instead of a value. To fix this you can try to call the value by it’s index, you can do this by using a for loop on the table.

I didn’t understand. How to use a for loop in a table? So, let me explain in the script.

How exactly are you getting the value in the first place? I don’t see it in the script, and if it is there, please point it out to me.

local engineInfo = {
	["Configurations"] = { -- The configurations, all numbers means whytes in any locomotives.
		[1] = "0-4-0",
		[2] = "0-6-0",
		[3] = "2-4-0",
		[4] = "2-4-2",
		[5] = "2-6-0",
		[6] = "2-6-2",
		[7] = "4-4-0",
		[8] = "4-4-2",
		[9] = "4-6-0",
		[10] = "4-6-2"

function engineInfo.MakeEngineInfo(engine, name, engType, slocation, configuration, topSpeed)
	if engineInfo then
		local engineConfiguration = Instance.new("TextLabel") -- The Engine's configuration is assigned when it selects any configurations from the top of the script but as seen in the engine information script.
		engineConfiguration.Name = "engineConfiguration"
		engineConfiguration.Size = UDim2.new(0.833, 0, 0.05, 0)
		engineConfiguration.Position = UDim2.new(0.083, 0, 0.69, 0)
		engineConfiguration.TextColor3 = Color3.new(1, 1, 1)
		engineConfiguration.BackgroundTransparency = 1
		engineConfiguration.Font = Enum.Font.SourceSans
		engineConfiguration.TextScaled = true
		engineConfiguration.Text = "Configuration: " .. configuration

		engineConfiguration.Parent = placeholder

		if not engine then
			error("Could not find " .. engine)
		end
	end
end
	}
}

This is the script I made, but it doesn’t work with some tables.