I don’t even know where to begin with this post because I know I sound like a conspiracy theorist, but I made a little simulator game over the past few months and at the beginning of May the load times launched from 4-8 seconds up to 60-90 seconds minimum without anything in-game being changed or adjusted by me.
I’m using ProfileService for my Player Data, and as far as I can tell everything should be working as intended. I’ve tried following this guide which implies that my issue has something to do with an unreleased Profile (which should not be the case),
I’m not really sure where else to go with this. I have truly done everything I can think of, please please please somebody tell me you’ve had this issue before and you know how to solve it before I rip my eyeballs out.
Server-side Data Script:
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Template = require(ReplicatedStorage.PlayerData.Template)
local Manager = require(ServerScriptService.PlayerData.Manager)
local ProfileService = require(ServerScriptService.Libs.ProfileService)
local ProfileStore = ProfileService.GetProfileStore("SkylandsReleaseData", Template)
local KICK_MESSAGE = "Data issue, try again momentarily."
local function CreateLeaderStats(player: Player)
local profile = Manager.Profiles[player]
if not profile then return end
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local coins = Instance.new("NumberValue", leaderstats)
coins.Name = "Coins"
coins.Value = profile.Data.Coins
local gems = Instance.new("NumberValue", leaderstats)
gems.Name = "Gems"
gems.Value = profile.Data.Gems
local ascensions = Instance.new("NumberValue", leaderstats)
ascensions.Name = "Ascensions"
ascensions.Value = profile.Data.Ascensions
end
local function LoadProfile(player: Player)
local profile = ProfileStore:LoadProfileAsync("Player_"..player.UserId)
if not profile then
player:Kick(KICK_MESSAGE)
return
end
profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
Manager.Profiles[player] = nil
player:Kick(KICK_MESSAGE)
end)
if player:IsDescendantOf(Players) == true then
Manager.Profiles[player] = profile
CreateLeaderStats(player)
Manager.ProfileLoaded:Fire(player, profile.Data)
Manager.GiveBadge(player, "Skylands Novice")
else
profile:Release()
end
end
for _, player in Players:GetPlayers() do
task.spawn(LoadProfile, player)
end
Players.PlayerAdded:Connect(LoadProfile)
Players.PlayerRemoving:Connect(function(player)
local profile = Manager.Profiles[player]
if profile ~= nil then
print(player.Name .. "'s profile has been released!")
profile:Release()
end
end)