Im not good ate DataStorage, and a good guys tryied to help me, but im still with this problem, i know it is my fault, and i cant see where is the problem
Save : this is in the script in the save button
local DataStoreService = game:GetService("DataStoreService")
local playerExperienceStore = DataStoreService:GetDataStore("PlayerDS")
local data = {} for k,v in pairs(stats:GetChildren()) do data[k] = v end PlayerDS:SetAsync( Player.UserId, data)
Load : this is in the script in the load Button
local DataStoreService = game:GetService("DataStoreService")
local playerExperienceStore = DataStoreService:GetDataStore("PlayerDS")
local PlayerData = PlayerDS:GetAsync( Player.UserId) for k,v in pairs(PlayerData) do stats[k].Value = v end
Save V2
local DataStoreService = game:GetService("DataStoreService")
local playerExperienceStore = DataStoreService:GetDataStore("PlayerDS")
function Click(mouse)
local data = {} for k,v in pairs(stats:GetChildren()) do data[k] = v
end
end
PlayerDS:SetAsync( Player.UserId, data)
script.Parent.MouseButton1Down:connect(Click)
Load v2
local DataStoreService = game:GetService("DataStoreService")
local playerExperienceStore = DataStoreService:GetDataStore("PlayerDS")
function Click(mouse)
local PlayerData = PlayerDS:GetAsync( Player.UserId) for k,v in pairs(PlayerData) do stats[k].Value = v
end
end
script.Parent.MouseButton1Down:connect(Click)

3 comments
don't worked :c
still not working ;~;
idk about save, but when i go to the other place, and load, the stats still 0 ( default ), i dont added scripts in the green positions yet