For reference,"$" Is the value im attempting to save (Player.leaderstats.$.Value)

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("Stats")

game.Players.PlayerAdded:Connect(function(Player)
	print("joined")
	local leaderstats = Player:WaitForChild("leaderstats")
	local Money = leaderstats:WaitForChild("$")
	Money.Value = DataStore:GetAsync(Player.UserId) or 0
	print("madeitthisfar)
end)

game.Players.PlayerRemoving:Connect(function(Player)
	DataStore:SetAsync(Player.UserId, Player.leaderstats.Money.Value)
end)

Obviously this wont work in studio, But it doesnt work in public servers either. Money will always have a value of 0 on join no matter

Ive spent atleast an hour trying to work around what could possibly be wrong nothing has caught my eye.

2 comments

0

Ignore the broken print *print("madeitthisfar)

0

In line 13, you put leaderstats.Money instead of leaderstats.$