Ошибка
leaderstats is not a valid member of Player "101Vova10" - Server - Leaderstats:19
Код
leaderstats is not a valid member of Player "101Vova10" - Server - Leaderstats:19
Код
local DataStore = game:GetService("DataStoreService")
local CashData = DataStore:GetDataStore("CashStats")
local Value = 0
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = ("Leaderstats")
leaderstats.Parent = player
local cash= Instance.new("IntValue")
cash.Name = ("Cash") --Cash Value
cash.Parent = leaderstats
cash.Value = 0 -- Starter Value
cash.Value = CashData:GetAsync(player.UserId) or Value
CashData:SetAsync(player.UserId, cash.Value)
game.Players.PlayerRemoving:Connect(function(player)
CashData:SetAsync(player.UserId, player.leaderstats.Cash.Value)
end)
end)