SurfaceGUI textbutton gives no responce?

Hello! I have a small issue, basically a textbutton in a surfaceGUI gives no responce?
(Local script)

--\\Variables//--
local Services = require(game.ReplicatedStorage.Modules.Services)
local Player = game.Players.LocalPlayer
--\\Main-Code//--
script.Parent.MouseButton1Click:Connect(function()
	print(Player)
	Services.Services.MarketPlaceService:PromptProductPurchase(Player,script.Parent.Parent.Configuration.ProductId.Value)
end)

When I used this (without the require for Services) it worked fine.

Try using a print outside of the Button1Click to see if Services comes up as nil.

Place the surface gui inside a ScreenGui, then go to the properties of the SurfaceGui and make the Adornee the Part you are looking to put it on and do a print() to see if it works
Buttons only work on that service

2 Likes

Sadly nothing is printing in the output at all.

--\\Variables//--
print("e")
local Services = require(game.ReplicatedStorage.Modules.Services)
print(Services)
local Player = game.Players.LocalPlayer
--\\Main-Code//--
script.Parent.MouseButton1Click:Connect(function()
	print(Player)
	Services.Services.MarketPlaceService:PromptProductPurchase(Player,script.Parent.Parent.Configuration.ProductId.Value)
end)

Still nothing is printing.

Your frame is inactive (Active is off). I’m not sure if this has something to do with it but normally it should be on for mouse button events to work.

The Screengui must be inside StarterGui, I see that it is in a block.
And inside the screengui created, the surfacegui

2 Likes

Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh right.

Thank’s for the help man + everyone else who helped!