GetAtributte is not a valid member of Player

oh yeah, sorry, I misspelled it. Well if I correctly put the Attribute

Could you show the full script where youā€™re setting the attributes?

1 Like

previously I put the script, and it is the only thing necessary for the attributes (the whole script would be very long)

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