Few flaws with loading script

There’s a couple of things that need to be addressed here. I’m going bottom up in terms of how I address these, to note.

  1. The last item in a table is equivalent to the number of items in a table. Instead of checking the value, check the indice. @iSkepticalBoi
if i == #Service then
    print("On last service.")
end
  1. Calling GetService on services does not make them load. It returns a service or inserts it if it does not exist in the DataModel. It doesn’t benefit you in any way to create a list of services and call GetService on all of them.

  2. Do NOT call PreloadAsync on all the contents of your place. Your place has a queue of assets that need to be downloaded so they can be displayed or rendered to the client. PreloadAsync pushes the items of request to the front of the list. Pushing everything to the front of the list effectively pushes nothing to the list.

    • You should only be preloading items you want the client to see first and immediately.

    • Long loading screens are horrid for UX design. You should be aiming to load as little as possible and let the rest of the download queue pass through in the background.

    • Anything that does not have an AssetId does not need to be preloaded.

  3. Parent your cover screens to the PlayerGui first before calling RemoveDefaultLoadingScreen. This will remove any potential discrepancies between what the player sees before their Roblox loading screen is removed and when your scripts take effect.

  4. You can shortcut any kind of loop or frame-bound code running with TweenService. Create an infinite tween that rotates the logo and you’re set.

1 Like