Button Problem in LocalScript

Hello I got a pretty weird problem with my buttons for the donating board, for some reason its not detecting my clicks whenever I press a button

https://gyazo.com/ef8e9059a665fdc34cca3727cfa40b0b
image

local button = script.Parent
local Player = game.Players.LocalPlayer
local MarketPlaceService = game:GetService('MarketplaceService')
local ProdID = 1319640492
	
button.MouseButton1Click:Connect(function()
	MarketPlaceService:PromptProductPurchase(Player, ProdID)
end)

Why do you guys love using MouseButton1Click instead of Activated?

1 Like

LocalScripts won’t work if they’re placed in the workspace - move it to StarterPlayerScripts or StarterGui, and see if it works then. (you’ll need to change the button variable and reference the specific button in the workspace if you change the localscript’s parent)

3 Likes


made it into an UI, but now it says this message, but the dev product is on sale

Nevermind, i found out how to fixt it