Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does the http service error?

Asked by 10 years ago

I have http service inserted and enabled and yet it for some reason wont work and I added prints and I found where the script error's.

I dont understand why is it not returning and outputing the music.

ERROR : attempt to index a field '?' (a nil value)

(And yes it is possible because I have seen others search music from httpservice) --Question answered by #Gravity Tech

Cmd(5,'Search Http Music','SM','Search Music From HttpService','<returns Service value>',function(Owner,Msg)
local http=game:GetService('HttpService')
print('Got Service')
local Url='http://rproxy.tk/catalog/json?Keyword='..tostring(Msg)..'&Category=9&ResultsPerPage=15'
print('Got URL')
local Assets=http:GetAsync(Url)
print('Got JSONdecode')
for i=1,#Assets do
print('Got for 1 data')
Tablet(Owner,Assets[i].Name,function()  ---------------------------------------[ !!! LOOK HERE !!! ]-------------
print('Got for each i = tablets')
local Sound=Instance.new('Sound',game.workspace)
print('Got Instance')
Sound.SoundId='rbxassetid://'..Assets[i].AssetId
print('Got assetid')
Sound.Volume=1
print('Got volume')
Sound.Pitch=1
print('Got pitch')
wait()
print('Got wait')
Sound:Play()
print('Got :Play()')
Dismiss(Owner)
print('Got Dismiss(Owner)')
end)                
end
end)

Answer this question