"No error, but looks good.."
Sorry, but this code is just horrific.
I assume you want to promt a purchase when the player clicks the gui?
local Player = Game:GetService('Players').LocalPlayer;
for i,v in next, script.Parent.Hats:GetChildren() do
v.ImageButton.MouseButton1Click:connect(function()
Game:GetService('MarketplaceService'):PromptPurchase(player, v.id)
end)
end
-- This should work. |