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

Why can't I press the Screen GUI to purchase items?

I'm working on my Studio, where I planned to make a button where you can purchase Player Points with the DevProduct while in-game.

However, the button is not working, yet I took a other look on the script, and I can't figure out the error.

My DevProduct Script:

local productId = Enter ID here -- change to your T-shirt/gamepass ID.
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
	Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

And here's the ShowDesc Script:

function OnMouseHover()
	script.Parent.Desc.Visible = true
end

script.Parent.MouseEnter:connect(OnMouseHover)

function OnMouseNotHover()
	script.Parent.Desc.Visible = false
end

script.Parent.MouseLeave:connect(OnMouseNotHover)

Am I missing a script code somewhere in those 2 scripts?

1 answer

If your title is correct, then the problem is pretty simply answered. ScreenGuis can't register as buttons - put a TextButton inside the ScreenGui and you should be set from what I can see.

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