I had tried this, doesn't seem to work.
Error: attempt to call global 'Elements' (a table value)
EqFrame.Desc.Text = Elements(item.Text).Description
Anybody have any ideas on how I can do this? I'd much appreciate it.
I had tried this, doesn't seem to work.
Error: attempt to call global 'Elements' (a table value)
EqFrame.Desc.Text = Elements(item.Text).Description
Anybody have any ideas on how I can do this? I'd much appreciate it.
If I understand your question correctly, you wanna access a table to change the text on a label to the value that the table has.
You would use [ and ] to access it and not ( and ).
EqFrame.Desc.Text = Elements[item.Text].Description
--// Variables
local TextLabel = script.Parent:WaitForChild("TextLabel")
local Desc = script.Parent:WaitForChild("Desc")
--// Tables
local Text = {["Info"] = {["Description"] = "Description?"}}
Desc.Text = Text[TextLabel.Text].Description
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Tried that, same error. But I appreciate the help. And yes that's what I want to do.