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

How and Why is the Value "Needs" not found in the Player when it is clearly there?

Asked by 4 years ago

I am trying to access the value "Needs" in a regular script from the player like this.

local char = tool.Parent
local player = game.Players:GetPlayerFromCharacter(char)
local needs = player.Needs

Error in output: "Needs is not a valid member of Player"

Anybody know why this error keeps happening? I even tried to do a :WaitForChild() but it then says there's an infinite yield trying to find "Needs." Needs has been inputted into the player yet the server still cannot find it.

0
What is the script adding "Needs" to the member player? Geobloxia 251 — 4y
0
It's not adding anything, "Needs" is the parent of multiple values. I'm trying to access needs so I can access the values in it but apparently it cannot find "Needs." SnakeInTheBoots 54 — 4y
0
Include more detail, put in all of the lines of code in the script. Master_Aaron 59 — 4y

1 answer

Log in to vote
0
Answered by
Lakodex 711 Moderation Voter
4 years ago

Are you using the leaderstats to be a localscript? You cannot do that as local can only be seen from the localside. Reply to this message with your response and I will redo this comment. Also please put your full script so we can check if its a lower script issue.

Ad

Answer this question