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

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

Asked by 8 years ago

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)
0
Can I ask where the location of your stats value is? scottmike0 40 — 8y
0
Inside my player, should I try using localplayer? LittleBigDeveloper 245 — 8y
0
Hell yes. scottmike0 40 — 8y
0
Same error LittleBigDeveloper 245 — 8y
View all comments (4 more)
0
Stats is a value right? scottmike0 40 — 8y
0
Yes, an IntValue LittleBigDeveloper 245 — 8y
0
there is your answer. scottmike0 40 — 8y
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'. BlueTaslem 18071 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

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)
0
Ohhhh, so all i needed to change was money.Value to game.Players.LocalPlayer.stats.money.Value LittleBigDeveloper 245 — 8y
0
Yep, also nicer to read, because you deal with less script.Parent stuff. scottmike0 40 — 8y
0
I also remembeed that the money was inside a value like IntValue > Money, just like leaderstats LittleBigDeveloper 245 — 8y
Ad

Answer this question