Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Prompting a User to Buy Clothes?

For some reason, the user is not prompted to purchase the ID of the clothes I want them to buy. Nothing happens when the button is pressed. What is wrong?

I get an error that TS is not a part of script.Parent, but it is?

local buyButton = script.Parent.SHIRT
local buyButton2 = script.Parent.TextButton
local buyButton3 = script.Parent.TS
player = game.Players.LocalPlayer

buyButton.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, 185788753)
end)

buyButton2.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, 185788727)
end)

buyButton3.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, 184263728)
end)

1 answer

Try using :WaitForChild() function, most ROBLOX clients are slow.

4 comments

0

So just put player = game.Players:WaitForChild("LocalPlayer")? It didn't seem to work.

0

No, no, no. player = game.Players.LocalPlayer:WaitForChild("somethinghere") for example: game.Players.LocalPlayers:WaitForChild("player.Character.Humanoid")

0

Maybe I got the asset IDs wrong?

0

Possibly.

This discussion is preserved as it was. New answers, comments, and votes are closed.