datstore = game:GetService("DataStoreService") local datast1 = datstore:GetDataStore("Yuan") local datast2 = datstore:GetDataStore("Gems") game.Players.PlayerAdded:Connect(function(plr) local folder = Instance.new("Folder",plr) folder.Name = "leaderstats" local gems = Instance.new("IntValue",folder) gems.Name = "Gems" local cash = Instance.new("IntValue",folder) cash.Name = "Cash" gems.Value = datast1:GetAsync(plr.UserId) or 0 datast1:SetAsync(plr.UserId, gems.Value) cash.Value = datast2:GetAsync(plr.UserId) or 0 datast2:SetAsync(plr.UserId, cash.Value) gems.Changed:Connect(function() datast1:SetAsync(plr.UserId, gems.Value) end) cash.Changed:Connect(function() datast2:SetAsync(plr.UserId, cash.Value) end) end)
You have to activate the API services thingy in your game settings.