Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Line 30 : Argument 1 missing or nil?

Here's the code :

--DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING
--Rate 240 HTTP requests per minute (try not to go over 500 in total)
local httpservice = game:GetService("HttpService") -- Refers to HttpService
local URL -- Refers to the URL that HttpService uses to get the games like and dislikes
local request --Gets 
local get -- Refers to the GET method of HttpService uses to get the likes and dislikes
local URL2 -- Refers to the URL that HttpService uses to get the visits and game name
local get2 -- Refers to the GET method of HttpService uses to get the place visits and game name
local URL3 -- Refers to the URL that HttpService uses to get the games favorites
local get3 -- Refers to the GET method that HttpService uses to get the games favorites
request = httpservice:GetAsync("https://api.rprxy.xyz/universes/get-universe-containing-place?placeid="..tonumber(game.PlaceId),true)
local parse = httpservice:JSONDecode(request)
for _,a in pairs(parse) do
	URL = "https://games.rprxy.xyz/v1/games/"..tonumber(parse.UniverseId).."/votes"
	URL2 = "https://games.rprxy.xyz/v1/games?universeIds="..tonumber(parse.UniverseId)
	URL3 = "https://games.rprxy.xyz/v1/games/"..tonumber(parse.UniverseId).."/favorites/count"
end
while wait(1) do
	local s,e = pcall(function()
		get=httpservice:GetAsync(URL)
		end)
	local parsed = httpservice:JSONDecode(get)
	for _,e in pairs(parsed) do
		script.Parent.Likes.Likes.Text = parsed.upVotes.." likes????"
		script.Parent.Dislikes.Dislikes.Text = parsed.downVotes.." dislikes????"
		end
	local ss,ee = pcall(function()
		get2=httpservice:GetAsync(URL2)
	end)
	local parsed2 = httpservice:JSONDecode(get2)
	for _,e in pairs(parsed2) do
		for _,g in pairs(e) do
			script.Parent.Visits.Visits.Text = g.visits.." Visits????"
			script.Parent.Title.Title.Text = g.name
		end
	end
	local sss,eee = pcall(function()
		get3=httpservice:GetAsync(URL3)
	end)
	local parsed3 = httpservice:JSONDecode(get3)
	for _,r in pairs(parsed3) do
			script.Parent.Favorites.Favorites.Text = tostring(parsed3.favoritesCount.." Favorites?")
	end
end

(The question marks are emojis or unsupported unicode)

1 answer

✓ Accepted answer

Where are you defining "UniverseId" ... That's my first guess lol

Error is telling you that the argument you're passing into JSONDecode is missing, so "get2" must be missing.

Line 28 get2 is defined (idk if there's any issues in this line, it looks fine to me?) using ULR2.

Line 15 URL2 is defined with a web link string and a variable "UniverseId" which I don't see being defined...

2 comments

0

Apparently its a HTTP error 429 even though the servers are good

0

Error 429 means that you're requesting things from the web too frequently, I think there's a maximum of 500/min... Is it possible to slow down the loop or call this less frequently? :)

This discussion is preserved as it was. New answers, comments, and votes are closed.