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

attempt to index local 'property' (a number value)? What does it mean?

Im getting this error when I run this script Players.Player.PlayerGui.Shop.Frame.Cash.LocalScript:2: attempt to index local 'property' (a number value) can anyone explain how to fix the script and what it means?

script.Parent.Parent.Parent.Parent.Parent.stats.money.Changed:connect(function(property)
	script.Parent.Text = "$"..property.Value
end)

8 comments

0

Can I ask where the location of your stats value is?

0

Inside my player, should I try using localplayer?

0

Hell yes.

0

Same error

0

Stats is a value right?

0

Yes, an IntValue

0

there is your answer.

0

You need to include your whole script when you post questions. The error has something to do with 'property' but this doesn't show you got 'property'.

1 answer

✓ Accepted answer

If in case your stats is In the player, Like this Diagram given that you have player = game.Players.LocalPlayers. Player --> Stats.money And Money is a int/double Value And the script is within the model then Then

player.stats.money.Changed:connect(function()
script.Parent.Text = "$".. player.stats.money.Value -- the first two parts of this code means that the ---------script is under the an Object and this Object above it contains a TextLabel, called Text. 
--as a result The Text becomes this money.Value.

end)

3 comments

0

Ohhhh, so all i needed to change was money.Value to game.Players.LocalPlayer.stats.money.Value

0

Yep, also nicer to read, because you deal with less script.Parent stuff.

0

I also remembeed that the money was inside a value like IntValue > Money, just like leaderstats

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