Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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.

4 comments

0

print it: print(AttributePoints) to double check if it's a int value

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.

0

Add the sript for players name I dont see palyers name so mabby dat why

0

Player is game.Players.PlayerAdded:connect(function(Player)

1 answer

✓ Accepted answer

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

1 comment

0

I have that on, but it still doesn't work it gives me the error,

This discussion is preserved as it was. New answers, comments, and votes are closed.