Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why do I keep getting an error when I try to save Data?

Asked by 5 years ago

I'm working on a level datastore, with stats. There is a value called attribute points, and everything works except I keep getting an error when trying to save data.

21:00:07.939 - Workspace.Script:57: attempt to index local 'AttributePoints' (a number value) 21:00:07.940 - Stack Begin 21:00:07.940 - Script 'Workspace.Script', Line 57 21:00:07.940 - Stack End

Here is the code

local Save_Interval = 120

    repeat

        local ValuesForSaving =      
       {Level.Value,LevelExp.Value,Attack.Value,Defense.Value,Agility.Value,AttributePoints.Value}
        DS1:SetAsync(uniqueKey,ValuesForSaving)
        wait(Save_Interval) 

    until 
    Player.Parent == nil 

Attribute Points is an Int Value, just like the other values, but they save where this doesn't.

0
print it: print(AttributePoints) to double check if it's a int value hellmatic 1523 — 5y
0
make sure your API services is turned on, to turn on go to Your Game Page > Configure Game > Basic Settings > Enable Studio Access to API Services and make sure the box is checked. ChillXeno 0 — 5y
0
Add the sript for players name I dont see palyers name so mabby dat why xb8y -11 — 5y
0
Player is game.Players.PlayerAdded:connect(function(Player) 88BlackRose 5 — 5y

1 answer

Log in to vote
0
Answered by
Plieax 66
5 years ago

Make sure you have "Enable Studio Access to API Services" enabled in the configure game tab? lmao if that doesn't work idk.

0
I have that on, but it still doesn't work it gives me the error, 88BlackRose 5 — 5y
Ad

Answer this question