For some reason, ProfileService isn't loading the profile properly. I think that is happening because I changed the data template, but how would I fix this issue?
Script:
local dataTemplate = {
Cash = 0,
Level = 0,
LogInTimes = 0
}
local ProfileService = require(game.ServerScriptService.Modules.Data.ProfileService)
local Players = game:GetService("Players")
local ProfileStore = ProfileService.GetProfileStore("PlayerData", dataTemplate)
local Profiles = {}
local function playerAdded(player)
local profile = ProfileStore:LoadProfileAsync("Player_".. player.UserId)
if profile then
profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
Profiles[player] = nil
player:Kick("a")
end)
if not player:IsDescendantOf(Players) then
profile:Release()
else
Profiles[player] = profile
end
else
player:Kick("b") --It's kicking the player here.
end
end
** You are now Level 7! **