Hello, Im trying to make it so when the player selects something in their inventory (My own inventory not roblox one) it shows some information about that item to be presented to the player. This information is stored in a module script in ReplicatedStorage. I’ve been getting this error “Unable to assign property Text. string expected, got table” for a couple hours now and I cant seem to find a solution
Error:
The code inside the Gui:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local InvFrame = script.Parent
local EquipFrame = script.Parent.Parent.EquipFrameSection
local DescriptionLabel = EquipFrame.Description
local NameLabel = EquipFrame.Title
local EquipButton = EquipFrame.EquipUseButton
local Clicked = false
local ItemPropertiesModule = require(ReplicatedStorage.Modules.ItemProperties)
local RarityColoursModule = require(ReplicatedStorage.Modules.ItemProperties.RarityColours)
for i, v in pairs(InvFrame:GetChildren()) do
if v:IsA("ImageButton") then
local ItemName = ItemPropertiesModule[v.Name]
local Description = ItemPropertiesModule[v.Name].Description
v.MouseButton1Click:Connect(function()
print("v", ItemName, Description)
if Clicked == false then
local RarityMod = ItemPropertiesModule[v.Name].Rarity
NameLabel.TextColor3 = Color3.new(RarityColoursModule[RarityMod])
Clicked = true
EquipButton.Visible = true
NameLabel.Visible = true
DescriptionLabel.Visible = true
NameLabel.Text = ItemName
DescriptionLabel.Text = Description
elseif Clicked == true then
Clicked = false
EquipButton.Visible = false
NameLabel.Visible = false
DescriptionLabel.Visible = false
end
end)
end
end
Note: The error is happening on line 27 “NameLabel.Text = ItemName” and I expect it to also happen to line 28 “DescriptionLabel.Text = Description”
Module Script:
local Items = {
["Egg"] = {
["Title"] = "Mythic Egg",
["Description"] = "t",
["Rarity"] = "Mythic"
},
["Egg2"] = {
["Title"] = "common egg",
["Description"] = "not a very cool egg",
["Rarity"] = "Commmon"
}
}
return Items