Is it possible to convert a string to a proprety?

What I mean is, e.g.,

Table = {TextLabel = 'TextTransparency'}

-- Just a example:
TweenService:Create(TextLabel, TweenInfo.new(), Table.TextLabel = 1)

Can I use that value stored in the table to do a TweenService like that?

local x = "TextTransparency"
print({ [x] = 1 }) -- Prints { TextTransparency = 1 }
------- ^ brackets around property
1 Like

That was not exactly what I wanted, but thanks for replying anyway. I achieved using the following thing (Wasn’t remembering this at the moment)

		local Table = {
			Frame = {
				BackgroundTransparency = 1
			},
			TextLabel = {
				TextTransparency = 1
			},
			ScrollingFrame = {
				ScrollBarImageTransparency = 1
			}
		}
		for Name, Proprety in next, Table do
			TweenService:Create(Instance, TweenInfo.new(), Proprety):Play()
		end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.