Need help with PreloadAsync

Hey all! I’m starting to get used to the basics of luau programming. I’m using PreloadAsync for my game to preload items and assets. Though it seems to preload the same existing assets, how would I make it so it checks if the said asset is already preloaded and skips or makes another check so the counter is a lot lower? And maybe if you know any ways to optimize the program I have provided below, that would help a ton!

Here is my code for the LoadingScreen:

local contentProvider = game:GetService("ContentProvider")
local replicatedStorage = game:GetService("ReplicatedStorage")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")

local modules = replicatedStorage:WaitForChild("Modules")
local func = require(modules.Functions)

local ui = script:WaitForChild("Loading"):Clone()
local skipButton = ui:WaitForChild("Skip")
local tips = ui.Tips
local plr = players.LocalPlayer
local plrGui = plr:WaitForChild("PlayerGui")

local skip = false

repeat task.wait() until game:IsLoaded() -- Change this to when playerData loads?

local assets_gameFolder = workspace.Game:GetDescendants()
local assets_RepStorage = replicatedStorage:GetDescendants()
local assets_PlrGui = plrGui:GetDescendants()
local assets_soundService = game:GetService("SoundService"):GetDescendants()

local maxAssetsGameFolder = #assets_gameFolder
local maxAssetsRepStorage = #assets_RepStorage
local maxAssetsPlrGui = #assets_PlrGui
local maxAssetsSoundService = #assets_soundService

local randomTips = {  -- helpful and joke tips
    "[TIP] You can upgrade your playing experience by visiting the researcher in your factory!",
    "[TIP] You are able to transform ores using the machine near the entrance of the mine to help you progress!",
    "[TIP] You can obtain rarer ores easily by crafting better gear, no ore is locked behind a paywall!",
	"[TIP] You can sell ores for money to upgrade your mining skills, such as mining range, and more located in your factory!",
	"[TIP] You can gain Experience from mining higher tier ores. The rarer the greater the reward!",
	"[TIP] You unlock more Star Ratings the higher the level you are, so keep progressing!",
	"[TIP] You can use the buttons on the bottom right to craft, configure settings, teleport, and more!",
	"[TIP] If you need assistance, click the \"Information\" button at the very top, and read under \"How to Play\"",
    "[NOTICE] We try our best to update the game as often as we can, but not adding too much content!",
    "[NOTICE] Need more assistance with the game? Feel free to join our community server and ask for help!",
    "[NOTICE] Feel like you can make ores and want to submit? We accept your submissions!",
    "[NOTICE] Sorry if the game took like, a year to release. We were extremely busy with other things.",
    ":WOAHcat:",
    "hah, bazinga! get it? it's funny right? bazinga? i'm not sorry",
    "Did you know you can eat water, by freezing it? Atleast, I think that's how it works.",
    "Where ever you currently are, you are currently somewhere.",
    "Does science work? Does 0 mean anything? Are humans really the only species in the entire universe? I'm losing it.",
    "If you're unlucky, just be lucky. Idk what to tell you.",
    "Every 60 seconds in Africa, a minute passes. You're welcome.",
    "Did you know? From 1999m-2000m, there is a special ore that has a 1/100,000,000 chance to spawn. I'm serious, or am I?"
}

ui.Parent = plrGui:WaitForChild("Intro")

func.typewriteEffect(tips, randomTips[math.random(1, #randomTips)])

print("-- PreLoading Assets -- --")

skipButton.MouseButton1Click:Connect(function()
	skip = true
	skipButton.Text = "Skipping..."
end)

local function preloadAssets(assets, maxAssets, assetType)
    for i, assetToLoad in assets do
        if not skip then
            contentProvider:PreloadAsync({assetToLoad})
			ui:WaitForChild("AssetName").Text = "Loading " .. assetType .. "..."
			ui:WaitForChild("AssetCounter").Text = i.." / "..maxAssets.." Assets Loaded"
			ui:WaitForChild("LoadingBar"):WaitForChild("barBG"):WaitForChild("Bar").Size = UDim2.new((i / maxAssets), 0, 1, 0)
			ui:WaitForChild("LoadingBar"):WaitForChild("barBG"):WaitForChild("Bar"):WaitForChild("Percent").Text = math.floor((i / maxAssets) * 100).."%"
        else
            ui:WaitForChild("LoadingBar"):WaitForChild("barBG"):WaitForChild("Bar").Size = UDim2.new(1, 0, 1, 0)
            ui:WaitForChild("LoadingBar"):WaitForChild("barBG"):WaitForChild("Bar"):WaitForChild("Percent").Text = "100%"
            break
        end
    end
end

preloadAssets(assets_gameFolder, maxAssetsGameFolder,"Workspace.Game")
preloadAssets(assets_RepStorage, maxAssetsRepStorage,"ReplicatedStorage")
preloadAssets(assets_PlrGui, maxAssetsPlrGui,"PlayerGui") -- seems to skip this one, unless theres a roblox related thing?
preloadAssets(assets_soundService, maxAssetsSoundService,"SoundService")

ui:WaitForChild("AssetName").Text = "Loaded!"
ui:WaitForChild("AssetCounter").Text = "Initializing..."
print("-- Finished PreLoad -- --")

task.wait(1)

local function createAndPlayTween(object, position)
    local fadeInfo = TweenInfo.new(3)
    local tween = tweenService:Create(object, fadeInfo, {Position = position})
    tween:Play()
end

-- best way i know how to do it sadly lol
createAndPlayTween(ui:WaitForChild("LoadingBar"), UDim2.new(0.213, 0, 1.5, 0))
createAndPlayTween(ui:WaitForChild("Skip"), UDim2.new(0.637, 0, 1.5, 0))
createAndPlayTween(ui:WaitForChild("AssetCounter"), UDim2.new(0.28, 0, 1.5, 0))
createAndPlayTween(ui:WaitForChild("AssetName"), UDim2.new(0.28, 0, 1.5, 0))
createAndPlayTween(ui:WaitForChild("Tips"), UDim2.new(0.279, 0, 1.5, 0))
createAndPlayTween(ui:WaitForChild("Version"), UDim2.new(0.279, 0, -1.5, 0))
createAndPlayTween(ui:WaitForChild("Warning"), UDim2.new(0.279, 0, 1.5, 0))

task.wait(2)
plrGui:WaitForChild("Intro").Holder.Visible = true

tweenService:Create(ui, TweenInfo.new(2), {Transparency = 1}):Play()

task.wait(3)

plr.Character:WaitForChild("HumanoidRootPart").Anchored = false

ui:Destroy()

Maybe you could try to use this: AssetFetchStatus | Documentation - Roblox Creator Hub

I’m not very sure how you would do this (i don’t use preload async)