How to load a function after GetAsync?
Asked by
4 years ago Edited 4 years ago
Detailed explanation here. I created a character customization menu and i stored the data on Server Storage. And then i created a function to load those each time the character respawns, which is player.Character.CharacterAdded. It works. The thing is, this script runs before the getAsync could get any data from the server so the first time a player joined. They will not load their customised character.
Now i temporarily fixed this by waiting around (5) to (10) after a character has been added, and then loading it. It works, but it isn't exactly giving my game a polished feel. Because it also affects the player respawn. Their custom char wont load until 5-10 sec.
Full script over here: https://pastebin.com/wKAkBTQn
(sorry if you cringe while reading the script. It's only been a few days since i started roblox studio with no experience in scripting at all so bear with me :> )
Alright. What should i do to make it run the load function after only after the data has been loaded from the server.
Any help would be greatly appreciated.