GetAtributte is not a valid member of Player

I used ctrl + f and wasn’t able to find any :GetAttribute.

1 Like

Well, I am confused. You mean the one who puts the attributes or the one who gets the attributes?

The one that puts the attributes.

1 Like

Ah no, the script that puts them, does not get them after putting it, it only puts them

I’m a little confused, can you show the script that is causing the error?

1 Like

It is not complete, but it gives me the error in obtaining the attribute, I mean, I realized that since the script that puts the attributes is very extensive, it took time to put the attributes, therefore, it gives an error, there are no until later in a few seconds

local Heartbeat = game:GetService("RunService").Heartbeat

local Players = game:GetService("Players")

local FpsLabel = script.Parent

local player = Players.LocalPlayer or Players:GetPropertyChangedSignal("LocalPlayer"):Wait() or Players.LocalPlayer

local FPS = player:GetAttribute("FPS")

Wait, is this a server script? Since you didn’t specify it.

2 Likes

Hmm, I’m actually kinda confused, not sure why it’s causing the error. Which line is causing the error?

1 Like

at least this part is server script

In this part specifically, from what i mentioned earlier that it doesn’t load the data on time

I mean the very first code you showed in your original post, is that from a local script or server script?

1 Like

ah, is a LocalScript, it does not work for me if the script is server

Yeah. The error looks like a spelling mistake. Can you send me a screenshot of your current code? Or just copy paste it without editing it.

1 Like

If they don’t load on time, or sometimes they load on time, you can use GetAttributeChangedSignal to update the variable, also inside you can put what should happen when you get the variable.

local FpsLabel = script.Parent
local player = game:GetService("Players").LocalPlayer
local FPS = player:GetAttribute("FPS") or ""
player:GetAttributeChangedSignal("FPS"):Connect(function()
	FPS = player:GetAttribute("FPS") or ""
end)
1 Like

Sorry for the delay, my computer is giving no more time to break downLocalScript - Roblox Studio 31_10_2021 07_51_15 p. m. (2)

1 Like

Wait, I’m doing a lot of things and I can’t focus on one. in a while I’ll put it to the test

I actually am not sure at all. Everything looks fine here. Even if the attribute would be nil when trying to retrieve it, it wouldn’t throw an error, it would just set the variable “FPS” to nil.

1 Like

I thought they were conflating attributes w/ properties, and typically player stats so to say are stored as some value type instance inside the player instance itself.

1 Like

This is an issue with accessing the GetAttribute member in Player, not that FPS isn’t a member of player.

Attributes return nothing if the attribute is undefined.
image

To the OP:
That code should work. LocalPlayer will always have a value in a LocalScript and the or Players:GetPropertyChangedSignal("LocalPlayer"):Wait() would never be reached.

It might be worth investigating to see if it’s this line, and not another line with the same call

1 Like

From what I have seen, I was right, it takes too long to put the attributes since the script exceeds 800 lines, that and that the script had to load all the data