Data Saving in my Game

Hey, I’m having trouble with the Data Saving script in my game. When I disable that script it fixes the issue, and when looking in the Output when my character first spawns in Studio, it says the line below, which is from the checkpoint script. The Output says the following:

0 is not a valid member of Folder "Workspace.Checkpoints

This is the line of script that the error message references:

char:MoveTo(checkpoints[stage.Value].Position)

Here’s a screenshot of the script as well:

image

I’ve searched everywhere online and there’s no clear answer. I even opened a new world and re-pasted the scripts, and still nothing. If anyone can help I would much appreciate it.

2 Likes

We can’t help you if you don’t provide us any scripts. We can’t fix the error without knowing the problem that comes the error from.
Could you show us what line is causing the error just press the error?

Yeah I realized that right as I posted it, sorry. I’m opening Studio right now to find the line :sweat_smile:

You’re making obby, because if so, the “0” is not an existing part, it’s gotta be 1 or above. You can’t use “0” as a part of a checkpoint

From the error I’m seeing it’s probably because the starting value is 0 make sure its 1.

I know that, here’s the parts and their names:

image

I was thinking that too, but I’ve typed 1:

image

So what is the problem exactly? Is it with the saving or so?

The issue is that, when the saving script is enabled, that error message pops up in the Output. When it’s disabled, of course nothing saves, but the error doesn’t pop up.

Is this script with the saving?

Sorry, what do you mean by that? They’re both in ServerScriptService if that’s what you mean.

I’m asking is this script handling the datastore with adding the currencies?

Try making a part 0 in the folder but make it completely invisible and change cancollide to false, just do that and after that dont mess with it

1 Like

Ah I’ll try that and let you know.

Okay, so it spawned me on that block that I just created, and if I replaced it with the block “1” then I would be spawning where I want to spawn, but then the leaderboard displays “0” instead of “1” which is also an issue.

So I think I may know how to fix it but tomorrow bc its late now

Alright sounds good, well thank you for the help so far.

Wow, well it works now, I had changed 1 thing in the script and then changed it back when it didn’t work, and now it’s working! Sorry for the trouble, and thank you for your time!

Alright sounds good, you have the same script as I do, I’m making a obby aswell!

1 Like