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

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

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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.

Ad

Answer this question