For some reason, data and data2 returns true, but, ‘data3’ doesn’t, but, when saving data3:
if (methods[Player.UserId]) then
print('methods!')
local other = methods[Player.UserId]:ReturnData()
if (other) then
print(other[1])
Datastore:SetAsync(Player.UserId,other)
end
end
Methods prints, aswell as the first value of ‘other’
BUT, says data3 is nil… no clue why.
local data
local data2
local data3
local success,errorr = pcall(function()
data = NewPlayerDatastore:GetAsync(Player.UserId)
data2 = Leaderstats:GetAsync(Player.UserId)
data3 = Datastore:GetAsync(Player.UserId)
end)
local petsystem = pets.begin(Player)
petsystem:Buy('Candy Butterfly')
methods[Player.UserId] = petsystem
if (success) then
print('success.')
if (data3) then
print('d3')
print(data3[1])
petsystem:SetTable(data3)
else
petsystem:SetTable({})
end
if (data2) then
print('data2!')
Suscribers.Value = data2['Suscribers']
Cash.Value = data2['Cash']
Quality.Value = data2['Video Quality']
end
if (data) then
print('Data!')
else
end