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

Prompting a User to Buy Clothes?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

0
So just put player = game.Players:WaitForChild("LocalPlayer")? It didn't seem to work. PancakeChop 35 — 9y
0
No, no, no. player = game.Players.LocalPlayer:WaitForChild("somethinghere") for example: game.Players.LocalPlayers:WaitForChild("player.Character.Humanoid") Asperanator -4 — 9y
0
Maybe I got the asset IDs wrong? PancakeChop 35 — 9y
0
Possibly. Asperanator -4 — 9y
Ad

Answer this question