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

Why does this script not work? It does not even register after variables

So, I have a brick, that has a surfacgui, that has a textbutton, that has a LocalScript. In the local script I have this code:

local p = game.Players.LocalPlayer
local g = script.Parent
local c = 43875114 

g.MouseButton1Down:connect(function()
	Game:GetService("MarketplaceService"):PromptProductPurchase(p, c)
    end)

What it's supposed to do, is prompt me with a purchase. This is a DevProduct. My friend says there is nothing wrong with the syntax, but it's not working. Any ideas? All help is appreciated!

4 comments

0

I know, but that was when I manually made it using a script. I wanted to remove that part, since it didn't work, when your player reset. Isn't there a way to already have the Gui ready? And then just add the script?

0

Local Scripts don't work in workspace unless they're a member of a character.

0

Do you mean like on the screen?, yes certainly.

1 answer

instead of g.MouseButton1Down, try p:GetMouse().MouseButton1Down

1 comment

0

I did that, but it does't prompt me.

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