So basically I want to store the initial positions of GUIS. This is being done in a for child in pairs loop. However, since there is no Udim2 value to place in the child, I put in a stringvalue instead, and filtered out the brackets. However, to convert it back to a UDim2, I also need to have the number values in the strings (0,5,6,1) for example, to be numbers, and if i use tonumber() it returns nil as the commas cannot be numbers. Hopefully that makes sense and explains my problem well enough?
Just in case that made no sense whatsoever:
local player = game.Players.LocalPlayer
for i, child in pairs(player.PlayerGui.ScreenGui.Frame:GetChildren()) do
local a = Instance.new("TextLabel",child)
a.Text = tostring(child.Position)
end
wait(10)
script.Parent:TweenPosition(UDim2.new(0.366, 0,0.135, 0),"In",.5)
game.ReplicatedStorage.Sound:Play()
wait(1)
script.Parent.Sound:Play()
for i, child in pairs(player.PlayerGui.ScreenGui.Frame:GetChildren()) do
local c = (string.gsub(child.TextLabel.Text,"{",""))
local b = tonumber(string.gsub(c,"}",""))
print(b)
child:TweenPosition(UDim2.new(b),"Out",.35)
end

3 comments
The problem is im doing this in child in pairs loop so I need like a physical value outside of script to be stored you know?
Use a string value object
Works. It does not work if i store it in a variable first had to access it directly. You are a legend lmao, roblox really overcomplicated this just create a Udim value :(