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

Why does it keep saying this item is currently not for sale?

Asked by 4 years ago
Edited 4 years ago
--Server script in serverscriptservice
rs = game:GetService("ReplicatedStorage")
ms = game:GetService("MarketplaceService")
remotes = rs.Remotes
pp = remotes:WaitForChild("Prompt_Purchase")
pp.OnServerEvent:connect(function(player, id)
    print(player.Name..", "..id)
    ms:PromptPurchase(player, id)
end)

--Local script in startergui
rs = game:GetService("ReplicatedStorage")
player = game:GetService("Players").LocalPlayer
mouse = player:GetMouse()
remotes = rs.Remotes
pp = remotes:WaitForChild("Prompt_Purchase")
mouse.Button1Up:connect(function()
    if mouse.Target.Name == "Purchase_Button" then
        local property = mouse.Target.Parent.Parent.Figure:FindFirstChild(mouse.Target:FindFirstChildOfClass("StringValue").Name)[mouse.Target:FindFirstChildOfClass("StringValue").Name.."Template"]
        local str = tostring(property)
        local id = tonumber(str:match("%d+"))
        pp:FireServer(id)
    end
end)

0
local property is basically getting the property ShirtTemplate or PantsTemplate from the clothing asset and then it gets the number from the link Vetrodex 22 — 4y

Answer this question