-
What do you want to achieve? Keep it simple and clear!
This a script for an inventory system. -
What is the issue? Include screenshots / videos if possible!
At line 187:invItem.CountDisplay.Text = "<b>" .. toolData.Count .. "x" .. "</b>
it is giving me the error “attempt to concatenate nil with string”. I know it is probably something really dumb and obvious, but i am still not very good with scripting and part of this script is from a tutorial.
Here is a screenshot of my Explorer as well with the textbutton i am trying to use called CountDisplay
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried googling this error, but i just cant seem to wrap my head around it. I feel it is most likely an error with the way i am trying to get the CountDisplay.
I have also through the video, and comments just to see if anyone else had ran into this error.
local function UpdatingDisplay()
--Clearing Out Current Inventory
removeItems()
--Getting Inventory Tools
local invItems = ScanItems()
for toolName, toolData in pairs(invItems) do
--Cloning TestItem Sample slot
local invItem = invSampleItem:Clone()
invItem.Parent = itemsSF
invItem.Name = "Item"
--Setting Display
invItem.CountDisplay.Text = "<b>" .. toolData.Count .. "x" .. "</b>" <------x Error line
invItem.Image = toolData.Items[1].TextureId
invItem.Visible = true
end
end