local HttpService = game:GetService("HttpService")
local plr = game.Players.LocalPlayer
local UserId = plr.UserId
local Endpoint = "https://inventory.rprxy.xyz/v1/users/%d/assets/collectibles"
local Success, Result, Response
local Count = 0
repeat
Success, Result = pcall(HttpService.GetAsync, HttpService, Endpoint:format(UserId))
Count += 1
wait(0.25)
until Success or Count > 5
if Success then
Response = HttpService:JSONDecode(Result)
local TotalRap = 0
for i, Asset in pairs(Response.data) do
if Asset then
TotalRap += Asset.recentAveragePrice
else
TotalRap = 0
end
end
script.Parent.Text = TotalRap
end
I’m not very experienced in scripting, but I believe what may be happening is that the script can’t read what the number value is for the recent Average Price. That and/or it needs the value “recent” to be defined in some way, how recent it should look for.
Move your code from a localscript to a regular script and make a RemoteEvent so that you can calculate the RAP value and send it to the client for them to handle.
Ah I see, so they may need to create another script to find the information where it then sends the information over to the specific script that activated it. And possibly creating a script line to create one of the information finding scripts to avoid all the traffic from all the other activation requests from messing up the information, if that’s needed, or if it’s possible, since I don’t know that local client scripts can create server scripts, unless one were to send a request to a reagular server script where that reagular script then create that new script. I’m going to just continue on rambling now I realize, since with what I described would all lead to it just continuously making new scripts.
But a script to collect that information then send it back would in theory work.