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?
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.
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.
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?
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.
Hmm, Iām actually kinda confused, not sure why itās causing the error. Which line is causing the error?
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?
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.
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)
Sorry for the delay, my computer is giving no more time to break down
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.