I'm trying to save a player's tycoon using Data Persistance and it doesn't seem to be working.
YES, I understand that Data Persistance is deprecated, but I don't think you can use DataStores to save Instances.
This is the script. It gives no errors. It is a script in ServerScriptService.
game.Players.PlayerRemoving:connect(function(player)
if player:WaitForDataReady() then
local TycoonName = player.PlayerTycoon.Value
local PlayersTycoon = game.Workspace.Tycoons:FindFirstChild(TycoonName)
player:SaveInstance("Tycoon", PlayersTycoon)
print("saved")
end
end)
game.Players.PlayerAdded:connect(function(player)
if player:WaitForDataReady() then
player:LoadInstance("Tycoon")
print("loaded")
end
end)
Any help is appreciated. Thank you!
