Made minor adjustments, I still need insight of what's going wrong without the rest of your project pieces.
function getTabFromAsync(async)
local tab = {}
for i = 1,#async do
if not async[i] == nil then
table.insert(tab,async[i])
else
return tab
end
end
return tab
end
function getNameAndMsg(txt)
-- FORMAT = 'nameñmsg'
local n
local plr
local msg
for i = 1,txt:len() do
if txt:sub(i,i) == 'ñ' then
plr = txt:sub(1,i-1)
msg = txt:sub(i+1)
end
end
return {plr,msg}
end
local data = game:GetService('DataStoreService'):GetDataStore('emails')
local usr = script.Parent.Parent.user.Value
for i,v in pairs(getTabFromAsync(data:GetAsync(usr))) do
local c = script.CloneMe:Clone()
c.Text = getNameAndMsg(v)[1]
c.Position = UDim2.new(0,0,0,(i-1)*24)
c.Visible = true
end |