Here’s the script, I believe I’ve done everything correct but may be mistaken,
All the Bounty, Information etc is loaded, it just isn’t saving.
Thanks in advanced!
local DataStore2 = require(game.ServerScriptService.DataStore2)
DataStore2.Combine("MasterKey7", "Bounty")
game.Players.PlayerAdded:Connect(function(Player)
local Information = Player:WaitForChild("Information")
local Bounty = Player:WaitForChild("leaderstats"):WaitForChild("Bounty")
local BountyData = DataStore2("Bounty", Player)
if BountyData:Get() == nil then
Bounty.Value = 0
else
Bounty.Value = BountyData:Get()
end
print(BountyData:Get())
end)
game.Players.PlayerRemoving:Connect(function(Player)
local BountyData = DataStore2("Bounty", Player)
local Bounty = Player:WaitForChild("leaderstats"):WaitForChild("Bounty")
BountyData:Set(Bounty.Value)
end)