Ok I understand where you are coming from but will the trello always return 3 strings?
I don’t know why is the return nil. Like, I have tired print(v[1]) for example and it’s nil … When I print(i,v) I normally get all values in table
Welp under the current constraints I am working with.
local RetString = {"SloveniaVideo,test,123"}
local SplitString = RetString:split(",")
local Gui = script.Rank:Clone()
for i,v in pairs(SplitString)do
local TextLabel = Gui:FindFirstChild("Val"..i) or false
if TextLabel then
TextLabel.Text = v
end
end
Gui.Parent = script.Parent.SurfaceGui.ScrollingFrame
I have this:
local RetString = valueSTR.Value
local SplitString = RetString:split(",")
for i,v in pairs(SplitString) do
local gui = script.Rank:Clone()
gui.Parent = script.Parent.SurfaceGui.ScrollingFrame
gui.Val1.Text = v[1]
gui.Val2.Text = v[2]
gui.Val3.Text = v[3]
end
Ok I edited the previous code so it would work, I am not sure if the Gui you cloned will be cloned again but if so you should be able to run a loop to do so.
Thank you very much!
It’s working!
We finally got to the end you are welcome my good sir.
One more question. Like not important one.
What means or false which you put in variable for Val?
local TextLabel = Gui:FindFirstChild("Val"..i) or false
I am not sure how to explain it properly but here goes. Variables can be either true or false, if a variables finds an object lets say
local workspace = workspace
if the workspace was found the variable would hold the workspace instance and be true, if workspace isn’t found then or false
just makes the variable false although if its not found I believe it returns nil. Its just a way for handling errors is what I would say.
Okay. Thank you for your help.
You’re welcome.