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

Gui Script... Please Help?

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

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.

2 comments

0

Thank You!

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.

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