Im trying to make a Surface Gui Thats a Store
local assetId = 16969792
script.Parent.MouseButton1Click:connect(function(player)
Game:GetService("MarketplaceService"):PromptPurchase(player, assetId)
end)
Whats Wrong with this script please?
Im trying to make a Surface Gui Thats a Store
local assetId = 16969792
script.Parent.MouseButton1Click:connect(function(player)
Game:GetService("MarketplaceService"):PromptPurchase(player, assetId)
end)
Whats Wrong with this script please?
From the Wiki:
MouseButton1Click ( ) Fired when the mouse has fully left clicked the GUI object.
MouseButton1Click doesn't pass any parameter (you are pretending it tells which player clicked).
ROBLOX does not currently have any API which allows a global SurfaceGui to distinguish between which player is interacting with it.
You should reimplement the shop using the Adornee property and move the SurfaceGui (and accompanying script) into the StarterGui (PlayerGui) instead of being in the object with the surface.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thank You!
Please use the "Accept Answer" button if an answer satisfies your question -- it lets everyone know where more time is needed and who needs more help.