-
What do you want to achieve? I want the booth to allow T-Shirts and gamepasses
-
What is the issue? There’s a problem that i can’t replicate, but it happens with my friend. When i claim a booth, it works perfectly fine. But when my friend tries to do it, it pops up with a error
Ignore the workspace.API, player data and PathFindingMaker errors, they’re unrelated
- What solutions have you tried so far? We can’t think up on how the hell does this happen.
Here are the scripts that are involved in the error.
AssetScript:
local avatarService = game:GetService("AvatarEditorService")
local http = game:GetService("HttpService")
local events = game.ReplicatedStorage.Events
local playerData = {}
local avatarURL = "https://catalog.roproxy.com/v2/search/items/details?Category=3&CreatorName=%s"
-- gamepass
local gameURL = "https://games.roproxy.com/v2/users/%s/games?accessFilter=Public&limit=50"
local gamepassURL = "https://games.roproxy.com/v1/games/%s/game-passes?sortOrder=Asc&limit=10"
function getGamepasses(games)
local completeList = {}
for index, playerGame in pairs(games) do
local gameGamepasses = http:JSONDecode(http:GetAsync(string.format(gamepassURL, playerGame.id))).data
for _,gamepass in pairs(gameGamepasses) do
gamepass["isGamepass"] = true
table.insert(completeList, gamepass)
end
end
return completeList
end
game.Players.PlayerAdded:Connect(function(plr)
local avatarItems = http:JSONDecode(http:GetAsync(string.format(avatarURL, plr.Name))).data
local playerGames = http:JSONDecode(http:GetAsync(string.format(gameURL, plr.UserId))).data
local playerGamepasses = getGamepasses(playerGames)
playerData[plr.UserId] = {}
local playerTable = playerData[plr.UserId]
playerTable["avatarItems"] = avatarItems
playerTable["playerGames"] = playerGames
playerTable["playerGamepasses"] = playerGamepasses
end)
script.GetData.OnInvoke = function(userid, item)
return playerData[userid][item]
end
StandHandler:
local tagService = game:GetService("CollectionService")
local booths = tagService:GetTagged("Booths")
for boothNumber:number, booth:Model in pairs(booths) do
local userUI = booth:WaitForChild("UserInformation"):WaitForChild("UI")
userUI.PlayerText.Text = "Unclaimed"
userUI.AdText.Text = ""
userUI.RecievedText.Text = ""
userUI.DonationText.Text = ""
local itemsScroller = booth:WaitForChild("DonationBoard"):WaitForChild("UI"):WaitForChild("List")
local proximityPrompt = Instance.new("ProximityPrompt", booth:WaitForChild("MainPart") )
proximityPrompt.HoldDuration = 1
proximityPrompt.ActionText = "Claim"
proximityPrompt.RequiresLineOfSight = false
proximityPrompt.Name = "StandProximityPrompt"
proximityPrompt.Triggered:Connect(function(plr)
local avatarItems = game.ServerScriptService.AssetScript.GetData:Invoke(plr.UserId, "avatarItems")
local gamepasses = game.ServerScriptService.AssetScript.GetData:Invoke(plr.UserId, "playerGamepasses")
local items = {table.unpack(avatarItems), table.unpack(gamepasses)}
table.sort(items, function(a, b)
return a.price < b.price
end)
print("TableOfItems: ", items)
if not items then return end
for index,product in pairs(items) do
--print(product)
local butt = script.DonateButton:Clone()
butt.Parent = itemsScroller
butt.Text = string.format("%dR$", product.price)
local id = Instance.new("IntValue", butt)
id.Name = "ID"
id.Value = product.id
local gamepass = Instance.new("BoolValue", butt)
gamepass.Name = "IsGamepass"
if product.isGamepass == nil then product.isGamepass = false end
gamepass.Value = product.isGamepass
end
end)
end
help