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

Gui Script... Please Help?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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?

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

0
Thank You! Dscpcheatsis1012 0 — 10y
0
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. BlueTaslem 18071 — 10y
Ad

Answer this question