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

Why is this erroring? [ HttpService ]

Asked by 10 years ago

I have NO IDEA why this is erroring.... I have another script that uses the same http sync and yet it doesnt error?!!?!?!

Please someone help me!!!!!

So searchm;Cool kids

My output : Cool kids Cool%20kids http://rproxy.tk/catalog/json?Keyword=Cool%20kids&Category=9&ResultsPerPage=5 HttpGet : http://rproxy.tk/catalog/json?Keyword=Cool%20kids&Category=9&ResultsPerPage=5 Time : 3.9 seconds ( Fairly long ) HTTP 203 ( Non-Authoratative Infomation ) Stack end

Instance_CMD('Searchm',1,function(Plr,Msg)
local Ser=game:FindService('HttpService')
print(tostring(Msg))
KeyWords=Ser':UrlEncode(tostring(Msg))
print(KeyWords)
 Url='http://rproxy.tk/catalog/json?Keyword='..KeyWords..'&Category=9&ResultsPerPage=5'
print(Url)
Assets=game:service'HttpService':JSONDecode(Ser':GetAsync(Url))
print(Assets)
----------------------------------------------
local PGui=game.Players[Plr.Name]['PlayerGui']
local PInstance={}
local Gui=Instance.new('ScreenGui',PGui)
Gui.Name='SM_Gui'
local Frame=Instance.new('ScrollingFrame',Gui)
Frame.BackgroundTransparency=0.5
Frame.Position=UDim2.new(0.6,0,0.1,0)
Frame.Size=UDim2.new(0.3,0,0.5,0)
Frame.ClipsDescendants=true
Frame.Draggable=true
Frame.Position=UDim2.new(0.6,0,-1,0)
Frame.ScrollBarThickness=20
Frame:TweenPosition(UDim2.new(0.6,0,0.1,0),GuiTweening,'Quad',0.1*3,false)
for _,v in pairs(Assets) do
local Text=Instance.new('TextButton',Frame)
Text.Style='RobloxRoundDropdownButton'
Text.Font='SourceSans'
Text.Size=UDim2.new(0.9,0,0.03,0)
Text.FontSize='Size14'
Text.Text=('Play '..v.Name)
print('Output asset(S)')
Text.MouseButton1Down:connect(function()
pcall(function()
RemoveSounds() 
NewSound(tonumber(v.AssetId))
end)
wait(1.5)
Gui:remove()
end)
end
end)


This is the error...

`local KeyWords=Ser':UrlEncode(tostring(Msg))
Url='http://rproxy.tk/catalog/json?Keyword='..KeyWords..'&Category=9&ResultsPerPage=5'
Assets=Ser':JSONDecode(game:service'HttpService':GetAsync(Url))

AND

for _,v in pairs(Assets) do
Text.Text=('Play '..v.Name)
Text.MouseButton1Down:connect(function()
RemoveSounds() 
NewSound(tonumber(v.AssetId))
end)
end`

Answer this question