Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleporting to another universe sometimes does not load DataStore?

Asked by 7 years ago
Edited 7 years ago

My code is working fine, there is nothing wrong with it, been using the same code for a few weeks now and I just added a new universe to my current game. So I will not be posting the code here, it has nothing to do with that. Read the full thing to understand.

So it's about 50/50 when it comes to the loading, sometime it'll load but sometimes it won't.

When it does not load there is no errors or prints, it's just like it ignores the script completely. But other times it'll load like there is no problem, is there a way to make it load 100% of the time? I've only worked with universes one other time and never had this problem.

My code to load waits for the values and the character to be fully loaded before loading the game, and once it loads it inserts a value inside the player that the save is loaded when they go to leave the save code either saves or does not save depending if that load value is in the player.

My loading script will retry until the player's values are all inserted and the player loads but when teleporting to another universe sometimes(50/50) it does not print anything or load anything at all, it does not save when they leave, so nothing is lost but it's just annoying as hell. I've been trying to figure it out all day...

EDIT I use a recursion function to wait until the values are all loaded into the game, it checks every second and if not it continues to retry for the ready value I have put into their info folder after a few seconds of their values being created. I know it's not the load script because sometimes it does not print anything from the load module. I have prints everywhere and when it actually does work it prints everything just fine.

So it has to be something to do with the game, not my code. Maybe the server it loading too fast before my character and info is actually put into it but I get no errors or anything, is there a way I can make sure the game is fully loaded and my character is completely loaded in a server script before I try and load their data?

0
I think I figured it out, put a RemoteEvent that fires when the character and all the values are loaded, once it fires it loads up the player and all their info. Works so far, so we'll see. Briicks 0 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Try using a WaitForChild("Tool Folder") and add the tool folder in between the parenthesis. It sounds like player is loading before tools but without the script there is no way to tell for sure

0
I have it so that it inserts a value into their values folder a few seconds after the game starts, once that value is inserted everything loads, using a recursion function until the ready value is inserted into the player. I know it's not the loading script because everything is loaded in 5 or so seconds before it actually tries to load their data. Briicks 0 — 7y
0
I think I figured it out, put a RemoteEvent that fires when the character and all the values are loaded, once it fires it loads up the player and all their info. Works so far, so we'll see. Briicks 0 — 7y
Ad

Answer this question