I made a script which detects if a mouse button is clicked ona surface gui. It was working but now it isnt?
while true do
for _, stand in pairs(game.Workspace.Stands:GetChildren()) do
for _, frame in pairs(stand.Products.Items.ScrollingFrame:GetChildren()) do
if frame:IsA("Frame") then
for _, robuxcost in pairs(frame:GetChildren()) do
if robuxcost:IsA("TextButton") then
robuxcost.MouseButton1Click:Connect(function()
game.ReplicatedStorage.HeyDawhg:FireServer()
if frame.ItemTypeId.Value == 34 then
mps:PromptGamePassPurchase(game.Players.LocalPlayer,frame.ItemID.Value)
else
mps:PromptPurchase(game.Players.LocalPlayer,frame.ItemID.Value)
end
end)
end
end
end
end
For some reason its not prompting the gamepass and Im not getting any errors? Thanks!