#data not saving

75 messages · Page 1 of 1 (latest)

lethal sparrow
#

this is my script, my data will not save when i give myself a click value of 1000 and leave and rejoin it does not stay.
-- Saving Data
game.Players.PlayerRemoving:Connect(function(player)
local playerUserID = "player_"..player.UserId

local clicksvalue = player.leaderstats.CLicks.value

local success, errormessage = pcall(function()
    clicksDataStore:SetAsync(playerUserID, clicksValue)
end)

end)

game:BindToClose(function(player)
for , Player in pairs(game.Players:GetPlayers()) do
local playerUserID = "player
"..player.UserId

    local clicksValue = player.leaderstats.CLicks.value

    local success, errormessage = pcall(function()
    clicksDataStore:SetAsync(playerUserID, clicksValue)
   end)
end    

end)

compact forge
#

Click value is a int value ?

lethal sparrow
compact forge
lethal sparrow
#

what do i change it to? int value?

compact forge
#

What is click value ?

lethal sparrow
#

im making a clicker game

devout geyserBOT
#

studio** You are now Level 1! **studio

lethal sparrow
#

so its the value of my clicks

#

so click value 1 is 1 click

compact forge
#

Is it your script ?

lethal sparrow
#

sorta

compact forge
#

Any error ?

lethal sparrow
#

copied it but changed a few things

#

nope

#

well i dont have an output section on studio so idk

compact forge
#

Because value is Value

compact forge
lethal sparrow
#

where is it? i cant find it at the bottom where it should be

compact forge
lethal sparrow
#

this is the whole thing i see no output unless im blind

#

ohh of course

#

i forgot to open it 🤦‍♂️

#

says this

compact forge
#

clicksvalue

lethal sparrow
#

what do i do with it?

#

i havent scripted in like a year i am very rusty 😅

compact forge
#

Lower v

lethal sparrow
#

ohh i thought it was capital?

#

oh of course all the other clickvalue is lowercase

#

wait no they arent?

#

do i change all the other clicksValue to clicksvalue

compact forge
#

This is the only error so no

lethal sparrow
#

ah alright

#

i shall try now

#

error says this but i havent messed with LocalScript?

#

it still does not save

devout geyserBOT
#

studio** You are now Level 2! **studio

lethal sparrow
#

D:

#

shush MEE6

#

can i just delete local script @compact forge coz i think it is to do with my button but i dont want that rn

#

i give myself the clicks and it says this?

compact forge
#

clicks

lethal sparrow
#

alright i changed it from CLicks to Clicks correct?

compact forge
#

clicks

lethal sparrow
#

still doesnt save

#

lowercase c?

#

alright thats done i hope it works now

#

bruhhh it stil does not work

#

still

#

:(

#

what do i do?

compact forge
#

Error ?

lethal sparrow
compact forge
#

clicks

#

Not Clicks

lethal sparrow
#

there is no Clicks tho

#

maybe

#

line 2

#

it is Clicks

compact forge
lethal sparrow
#

is that maybe why? should i change that to clicks

compact forge
#

clicks

lethal sparrow
#

oh boy i am so blind

#

alright all clicks are lowercase now time to test

#

the person i took inspiration from has leaderstats.Clicks.Value tho and it worked for them?

#

well good sign is there is no errors

compact forge
lethal sparrow
#

IT SAVED

devout geyserBOT
#

studio** You are now Level 3! **studio

lethal sparrow
#

AAA

#

TYSM