1 Like
Remove the .Name
print( data.get_owner(player) )
Replace the line 19 in the script you’ve mentioned (post 1
) with:
function module.is_group_id(id)
local request_str = "https://groups.roproxy.com/v1/groups/"..id
local success, result = pcall(function()
return HttpService:GetAsync(request_str, true)
end)
if success then
return true
else
return false
end
end
function module.is_group_id(id)
print( id, typeof(id) )
local request_str = "https://groups.roproxy.com/v1/groups/"..id
local success, result = pcall(function()
return HttpService:GetAsync(request_str, true)
end)
if success then
return true
else
return false
end
end
Show what it print before the error.
Try this (your code is working for me)
function module.is_group_id(id)
local request_str = "https://groups.roproxy.com/v1/groups/"..tostring(id)
local success, result = pcall(function()
return HttpService:GetAsync(request_str, true)
end)
if success then
return true
else
return false
end
end
its commtied
local module = {}
local HttpService = game:GetService("HttpService")
local function get_next_page(request, cursor)
local request_str = request.."&Cursor="..cursor
local success, result = pcall(function()
return HttpService:GetAsync(request_str)
end)
if success then
return HttpService:JSONDecode(result)
else
warn(result)
return {}
end
end
function module.is_group_id(id)
local request_str = "https://groups.roproxy.com/v1/groups/"..tostring(id)
local success, result = pcall(function()
return HttpService:GetAsync(request_str, true)
end)
if success then
return true
else
return false
end
end
local function request(str, id)
local success, result = pcall(function()
return HttpService:JSONDecode(HttpService:GetAsync(str))
end)
local id_list = {}
if success then
local page = 1
while result and page <=2 do
local data = result.data
if data then
local cursor = result.nextPageCursor
for _, item in ipairs(data) do
table.insert(id_list, {item.id, item.price, item.name})
end
if cursor then
page += 1
result = get_next_page(str, cursor)
else
break
end
else
break
end
end
else
warn("Couldn't get", id, "'s item list.")
warn(result)
end
return id_list
end
function module.get_user_item_list(player)
local request_str = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=1&userId="..player.UserId.."&Limit=30&MinPrice=2&SortType=4"
if request_str ~= nil then
return request(request_str)
end
end
function module.get_group_item_list(group_id)
local request_str = "https://catalog.roproxy.com/v1/search/items/details?Category=1&CreatorType=2&CreatorTargetId="..group_id.."&Limit=30&MinPrice=2&SortType=4"
return request(request_str)
end
function module.get_item_list(player, id, Items)
if module.is_group_id(id) then
return module.get_group_item_list(id)
else
return module.get_user_item_list(player, Items)
end
end
return module
line 65
function module.get_user_item_list(id)
local request_str = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=1&userId="..tostring(id).."&Limit=30&MinPrice=2&SortType=4"
if request_str ~= nil then
return request(request_str)
end
end
line 77
function module.get_item_list(player, id, Items)
if module.is_group_id(id) then
return module.get_group_item_list(id)
else
return module.get_user_item_list(id)
end
end
Try debugging by adding print to your booth gamepasses button display.
sorry what ??? im so confused
In your booth script, try adding print
(where you load your gamepass buttons)
and check if the data exists or not.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local modules = ReplicatedStorage.Modules
local shorten = require(modules.Shorten).shorten
local remotes = ReplicatedStorage.Remotes
local buttons_added_remote = remotes.ButtonsAdded
local buttons2_added_remote = remotes.Buttons2Added
local proximity_remote = remotes.EditProximityPrompt
local request_purchase_remote = remotes.Purchase
local add_product_remote = remotes.AddProduct
local stands = workspace.Stands
local edit_prompt = script.Edit
local buy_button = script.Buy
local gui = script.TextInput
local player = Players.LocalPlayer
local player_gui = player.PlayerGui
local buy_size = buy_button.Size
local buy_size_end = buy_size + UDim2.fromScale(.1, .1)
local products = {}
local function remove_all_buttons(frame)
for _, child in ipairs(frame:GetChildren()) do
if child:IsA("GuiButton") then
child:Destroy()
end
end
end
local function button_clicked(button, stand_id, product_id, other)
request_purchase_remote:FireServer(stand_id, product_id, other)
end
local function prompt_triggered(player, stand_id)
if not player_gui:FindFirstChild("TextInput") then
local text_gui = gui:Clone()
local textinput = text_gui.Holder.TextInput
textinput.Text = stands[stand_id].Text.Gui.TextLabel.Text
text_gui.Parent = player_gui
end
end
buttons_added_remote.OnClientEvent:Connect(function(stand_id, products)
local stand = stands[stand_id]
local listings_frame = stand.Listings.Gui.ScrollingFrame
remove_all_buttons(listings_frame)
wait(.25)
for _, item in ipairs(products) do
local button = buy_button:Clone()
button.Text = shorten(item[2]).."$"
button.Parent = listings_frame
button.MouseEnter:Connect(function()
button:TweenSize(buy_size_end, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, .5, true)
end)
button.MouseLeave:Connect(function()
button:TweenSize(buy_size, Enum.EasingDirection.In, Enum.EasingStyle.Quad, .5, true)
end)
button.MouseButton1Click:Connect(function()
button_clicked(button, stand_id, item[1])
end)
end
listings_frame.CanvasSize = UDim2.fromScale((#listings_frame:GetChildren()-2)*0.26, 0)
end)
proximity_remote.OnClientEvent:Connect(function(stand_id, p)
products = p
local prompt = edit_prompt:Clone()
prompt.Parent = stands[stand_id].Claim
prompt.Triggered:Connect(function()
prompt_triggered(player, stand_id)
end)
end)
here script is. Where to add?