Datastore broken

Yes. And on the side, I can see the “Points” value works, just not Clicks.

This is now in the TextLabel, adding it into the button now:

local plr = game.Players.LocalPlayer
local RS = game:GetService("RunService")
local leaderstats = plr.leaderstats
local parent = script.Parent
game:WaitForChild("Clicks")
local c
c = RS.RenderStepped:Connect(function()
	wait()
	parent.Text = leaderstats.Clicks.Value.." Clicks"
end)


local plr = game.Players.LocalPlayer


local leaderstats = plr.leaderstats

local parent = script.Parent

parent.MouseButton1Click:Connect(function()

wait()

leaderstats.Clicks.Value = leaderstats.Clicks.Value + 1

end)

ok so… the script that you sent… there is a space in front of Clicks. Thats why it cant find it

That’s not how you do it, Clicks is not part of game, it’s part of your leaderstats. Refer to this to understand the syntax.

Where? There’s no space.
image
Space is:
image
In the DS: image

But there is a space there.
That’s why it can’t find it
image

This was is the one he is talking about

With this you are changing Data only for the player (locally) not on the server.

Which script? There multiple scripts.

That has nothing do do with the Leaderboards.THAT is for the counter. it should display as “# CLicks”

I mean click on the “arrow”, you will see for which script I responded.

You cant get on the server variable
game.Players.LocalPlayer

Hi,

i see that in your code, when you are adding a new value, you are setting the async and not getting the async. GetAsync() should also be used in a pcall to utilize any errors.

Good luck with your code!

2 Likes

Still have NO idea. Why is this so hard to fix? Legit 75 “comments” and still a broken DS.

Many devolpers would agree That DataStore 2 is better

and

This would be a great tutorial to watch

Hey,
I don’t recommend saving the player Points / Clicks every time they changed

Instead Save the data when player leave or the server shut down using game:BindToClose()

2 Likes

In theroy that would minimize lag correct?

Kinda Right,

When you’re trying to save too much data in a few seconds The DataStore will add it to the Queue
(Wait List In Short)

More Info:

Oh and then that causes some of it not to save.

1 Like