Hi.Hope this message find you safe and sound.
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local Cash = Instance.new("NumberValue",leaderstats)
Cash.Name= "CashValue"
while wait()do
Cash.Value = game.Workspace.tycoon.tycoonHouse.Dropper.Value.Value
end
end)
My leaderboards script 
local DataStoreService = game:GetService("DataStoreService")
local myData = DataStoreService:GetDataStore("CashData")
game.Players.PlayerAdded:Connect(function(player)
print("You have entered")
local UserID = player.UserId
local data
print("Pcall starts!")
local success, errorMessage = pcall(function()
data = myData:GetAsync(UserID.."-Cash")
print("Hi")
end)
if success then
player.leaderstats.CashValue.Value = data
print("Hi")
else
print(":(")
warn(errorMessage)
end
print("Not leaderstats")
end)
game.Players.PlayerRemoving:Connect(function(player)
print("Entered")
local UserID = player.UserId
print("leaved")
local success, errorMessage = pcall(function()
myData:SetAsync(UserID.."-Cash",player.leaderstats.CashValue.Value)
print(player.leaderstats.CashValue.Value) -- Value printed as us
end)
if success then
print("DataSaved")
else
print("dataNotSaved")
warn(errorMessage)
end
end)
My datastore script 
My datastore is currently working very fine.It is able to change the leaderboards’ value to the number that is inserted.I tested out by changing the leaderstats Cash Value and it worked.
However, whenever I join to test, the cash value is reset to 0 ,instead of the data saved.
Is there any viable method?
Thank you sincerely from me.