I have been working a feature in a story game that whenever you enter one of those gate like in the games doors or day-care, a variable will keep a hold of how many people entered the gate. Then when you get teleported to the main story, the variable will be transferred to the main game, this is used for counting how many players are in the server, so that I can play specific cutscenes if there are only one person, or an another cutscene only to be seen if there are 2 players in the server. I have made a quick code to test if this works, and when I print the variable (which I named data), it is supposed to print out 1 (because I’m the only one in the server) but instead the output will show null. I do not what I did wrong, can someone please spot any mistakes that I potentially did? Thanks for reading.
so create a datastore using the datastore service, then when you teleport the player to the next place, just go into the datastore using the datastore service, and set a variable to the value in the datastore
I just attempted to do what you just said, but it didn’t really work for me. Is either I still do not understand on what you mean or your explanation does not work.