How would I get the Player who clicked the TextButton. The TextButton is in a surface GUI on a part in the workspace, so it is running off a Script, not a LocalScript.
local MarketplaceService = game:GetService("MarketplaceService")
local productID = 515812556
script.Parent.MouseButton1Click:Connect(function(Player)
print("working")
if Player:GetRankInGroup(3563533) >= 30 then
MarketplaceService:PromptProductPurchase(Player, productID)
end
end)

3 comments
The only thing I can think of would be to put a part in front of the button and place a click detector in it, then you can get the player when the player clicks the click detector.
Just use a local script man.
He can’t use localscript it’s in workspace