Attempt to index number with ' Name ' [Repost]

Can you please show a screenshot of the output, as I mentioned above?

Thats why it is nil, the value variable has no value.Name property attached to it in that function. Please try the solution, because setting a value to another value instance makes no sense whatsoever.

yes here is it

Please show the stack below the error so that we can see the other lines as well.

(from where it says Stack begin up to Stack end below the error)


here i dont see a stack error

Please provide line 30 of your “Datastore” script AND line 64 of your “Fuwa” script.

It seems like the error has a “stack”, and here there are 2 lines of it. Please send them so I can investigate both.

Data store line 28 - 38

function changeValue(player, valueName, value)
	
	if dataFolder[player.Name][value.Name] then
		dataFolder[player.Name][valueName] = value
	end
	
	checkMastery(player)
	
	remote:FireClient(player, "GiveData", dataFolder[player.Name])
	
end

Fuwa line 63 to 64

DataOfPlayer = DataStore:WaitForChild("BlindFunction"):Invoke("GetData", Player)
DataStore:WaitForChild("BlindFunction"):Invoke("ChangeData", Player, "EtcMasteryExp", DataOfPlayer["EtcMasteryExp"] + (math.random(1, 10)))

here is checkMastery

function checkMastery(player)
	if dataFolder[player.Name]["EtcMasteryExp"] >= dataFolder[player.Name]["EtcMasteryExpNeeded"] then
		dataFolder[player.Name]["EtcMasteryExp"] = 0
		dataFolder[player.Name]["EtcMasteryExpNeeded"] = dataFolder[player.Name]["EtcMasteryExp"] + math.random(150, 350)
		dataFolder[player.Name]["EtcMastery"] = dataFolder[player.Name]["EtcMastery"] + 1
		remote:FireClient(player, "GiveData", dataFolder[player.Name])
	end
end

On line 30 of the Datastore script, you have written “value.Name” which is the problem, since that parameter “value” contains a number. Try changing it to “valueName”

Instead of
if dataFolder[player.Name][value.Name] then

You can write
if dataFolder[player.Name][valueName] then

I am not sure if this will work, but consider trying this solution.

I wonder why line 30 is erroring! Maybe it is stated in my post. Please actually implement the fix if you want this post to ever get solved.

Post with solution: Attempt to index number with ' Name ' [Repost] - #17 by CoIorEvent

i do it and now is function i just gonna fix the gui and i will back if the results

thank you soo much and every body that help too, now its working very well

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.