基本的Data Script是這樣的哦
local DSS = game:GetService(“DataStoreService”)
local PlayerCash = DSS:GetDataStore(“Cash”)
game.Players.PlayerAdded:Connect(function(Player)
local Folder = Instance.new("Folder")
Folder.Name = "Data"
Folder.Parent = Player
local Cash = Instance.new("IntValue")
Cash.Name = "Cash"
Cash.Parent = Player.Data
Cash.Value = PlayerCash:GetAsync(Player.userId) or 0
end)
game.Players.PlayerRemoving:connect(function(Player)
PlayerCash:SetAsync(Player.userId, Player.Data,Cash,Value)
end)