No, don’t worry about this, your variables’ scopes are fine; May I see your code now, after you’ve applied the changes?
2 Likes
It still looks the same to me, lines 38 and 39 should look like this
DataStore:SetAsync("points-"..player.UserId, player.leaderstats.Points.Value)
DataStore:SetAsync("rebirths-"..player.UserId, player.leaderstats.Rebirths.Value)
2 Likes
Oh. I only changed one of my functions.
2 Likes
Ok, I changed It to Points and Rebirths instead of points and rebirths
2 Likes
Try running this line of code and tell me what do you get in the output
print(pointsData)
3 Likes
at the bottom of the If or before the code that doesn’t run?
2 Likes
After the if statement
if pointsData then
2 Likes
It did print. So should the data store work now.
2 Likes
If it does print the correct value then I don’t see the issue.
2 Likes
oh I accidentally printed a string.
1 Like
Ok the DataStore is working now. That function wasn’t working earlier because of a different script I think. Thanks for the help!
4 Likes
No problem, glad I was helpful!
8 Likes
I’m still learning so everything helps
6 Likes