Hey,
I want to reset my own data in my game. I added this line
ProfileStore:WipeProfileAsync(“Player_1240678162”)
but when joining the game my stats arent reset.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local HttpService = game:GetService("HttpService")
local ProfileTemplate = {
Hive = {
[1] = {
Lvl = 1,
CellNum = 1,
}
},
Bought = {},
Codes = {
["Release"] = {
redeemed = false,
reward = 1000,
},
["Dragons"] = {
redeemed = false,
reward = 1000,
}
},
OnDepositProcess = 0,
DepositPerSec = 2,
UpgradeDepositPrice = 1,
AddCellPrice = 3,
HighestLevel = 1,
Coins = 0,
Drops = 0,
Kills = 0,
Droppers = 1,
EXP = 0,
Level = 1,
Settings = {
}
}
local DataManager = {}
DataManager.__index = DataManager
local self = setmetatable({}, DataManager)
local ProfileService = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("DataService"):WaitForChild("ProfileService"))
local TycoonService = require(ReplicatedStorage.Modules:WaitForChild("TycoonSystem"):WaitForChild("TycoonService"))
local GameSettings = require(ReplicatedStorage.Modules:WaitForChild("Game"):WaitForChild("GameSettings"))
local Players = game:GetService("Players")
local ProfileStore = ProfileService.GetProfileStore(
"Final1",
ProfileTemplate
)
local Profiles = {}
local function onPlayerAdded(player)
local profile = ProfileStore:LoadProfileAsync("Player-" .. player.UserId)
if profile ~= nil then
profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
Profiles[player] = nil
player:Kick()
end)
if (player:IsDescendantOf(Players)) then
Profiles[player] = profile
else
profile:Release()
end
else
player:Kick()
end
ProfileStore:WipeProfileAsync("Player_1240678162")
end