okay so im trying to make an enemy editor that can grab items from the roblox catalog using some cool APIs but it just doesnt want to work and gives me this error; “HttpService is not allowed to access ROBLOX resources”
SCRIPT
local event = game.ReplicatedStorage.Events.InsertModels
local marketplaceservice = game:GetService("MarketplaceService")
local insertservice = game:GetService("InsertService")
local assetservice = game:GetService("AssetService")
local Http = game:GetService("HttpService")
local AssetTypes = {
["Hat"] = 9,
["Shirt"] = 12,
["Pants"] = 14
}
local url = "https://catalog.roblox.com/v2/search/items/details?Subcategory="..AssetTypes["Hat"].."&SortType=0&SortAggregation=5&Limit=30"
local pages = 25
local assets = {}
event.OnServerEvent:Connect(function(player,idx)
print("created")
for i = 1, pages do
local response = Http:GetAsync(url)..tostring(i)
local data = Http:JSONEncode(Http:GetAsync(url))
data = Http:JSONDecode(data)
for ii = 1, #data do
local asset = data[ii]
local id = asset.AssetId
local name = asset.Name
assets[#assets + 1] = "{Id = " ..id .. ", Name = \"" .. name .. "\"}"
print(name)
end
print(i)
end
local source = "return { \n\t" .. table.concat(assets, ",\n\t") .. "\n}"
print(source)
end)