как сделать таблицу лидеров с сохранением
Автор: Bacon
Загружено: 2025-04-02
Просмотров: 72
Описание:
скрипт:
local ds = game:GetService("DataStoreService")
local cashds = ds:GetDataStore("CashSave")
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue", leaderstats)
cash.Name = "cash"
cash.Value = cashds:GetAsync(plr.UserId) or 0
game.Players.PlayerRemoving:Connect(function()
cashds:SetAsync(plr.UserId,plr.leaderstats.cash.Value)
end)
end)
без сохранений:
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue", leaderstats)
cash.Name = "cash"
end)
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: