Can't get visits of game

I’m attempting to make a game like hazems player rng, but with games instead. I’m currently facing an issue with getting a games visits count. It is not working. My code:

function GetGameData(TypeOfData, PlaceId)
	local universeId = HTTPService:GetAsync("https://apis.roproxy.com/universes/v1/places/" .. PlaceId .. "/universe")
	print(universeId)
		if TypeOfData == "Visits" then
			local success, json = pcall(function()
				return HTTPService:GetAsync("https://games.roproxy.com/v1/games?universeIds=" .. universeId)
			end)

			if success then -- its not successful, since it doesnt print
				local response = HTTPService:JsonDecode(json)
				local visits = response.data[1].visits
				print("visit count: "..visits)
			end
			
		

so, the second returned parameter in the pcall can show the error too, try printing the variable json then check if you did something wrong

haha dont worry. im just stupid and didnt even think to take a simple look at the script i simply just copied from another post on the dev forum :sob:. i fixed it now, thanks anyways

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.