From what i can understand is that this script has been runned twice:
local Profile = ProfileStore:LoadProfileAsync("Player"..Player.UserId)
well there shouldn’t be a way for it to run twice
here’s the relevant code i’m using:
local function PlayerAdded(Player: Player)
local Profile = ProfileStore:LoadProfileAsync("Player"..Player.UserId)
if Profile == nil then
Player:Kick("Data issue, try again shortly. If issue persists, contact us!")
return
end
Profile:AddUserId(Player.UserId)
Profile:Reconcile()
Profile:ListenToRelease(function()
Manager.Profiles[Player] = nil
Player:Kick("Data issue, try again shortly. If issue persists, contact us!")
end)
if Player:IsDescendantOf(Players) then
Manager.Profiles[Player]= Profile
CreateAllPhysicalValues(Player)
else
Profile:Release()
end
local function CharacterAdded(Character)
local Player = Players:GetPlayerFromCharacter(Character)
local Profile = Manager.Profiles[Player]
if Profile == nil then return end
local Folder = Instance.new("Folder", Character)
Folder.Name = "PetsEquipped"
short_cuts:TweenCharacterSize(Character, Profile.Data.Settings.Height)
Character:PivotTo(game.Workspace.Teleports[Player.Extra_Values.World.Value].CFrame)
script.PlayerStats:Clone().Parent = Character.Head
end
if Player:HasAppearanceLoaded() then
CharacterAdded(Player.Character)
end
Player.CharacterAppearanceLoaded:Connect(function(Char)
CharacterAdded(Char)
end)
end
for _, player in ipairs(Players:GetPlayers()) do
task.spawn(PlayerAdded, player)
end
Players.PlayerAdded:Connect(PlayerAdded)
Players.PlayerRemoving:Connect(function(Player)
local profile = Manager.Profiles[Player]
if not profile then return end
print(profile.Data)
profile:Release()
end)