Selecting a child using a string value

So I’m making a script that requires me to select a child of a scrolling frame. I’m trying to select it based on a combined string to represent the child I’m attempting to select.
The most I need to know is what in the world this is called so I can do some research on it.

local function renamePlayerFrame(plr)
	frameCount += 1 --defined earlier in the script
	if plr.Name ~= client.Name then --Assures we're not putting the current player into the list
		local slotAddress = "slot"..tostring(frameCount) --Combines a string to the integer to get the child
		
		scrollingFrame(slotAddress) --// The Problem \\
		-- Trying to take the value of *slotAddress* and select a child of *scrollingFrame* using that value (string)

	end
end

I appreciate any and all help I can get!

you can try one of these

scrollingFrame[slotAddress]
scrollingFrame:FindFirstChild(slotAddress)

1 Like

That easy… Hahaha of course! Thanks a lot!
Do you know what this is called?

Index of the array?

image

Or maybe the ‘key name’ in case of a dictionary.

an instance isn’t an array
honestly I’m not entirely sure why Instance[ChildName] works

1 Like

Okay, yep, i see what you’re saying, I didn’t look at the code close enough, I saw the brackets and thought it was a table. Yeah, idk why they have brackets interchangeable with the dot indexer. I know when I have special characters in an instance name it automatically replaces . with [“weird-instance-name-here”]

2 Likes