When I try close the gui by pressing the exit button, nothing happens. Any ideas why?
local function donateButtonClicked(donateButton)
local itemId = donateButton.Value.Value
local itemPrice = donateButton.Price.Value
MarketPlaceService:PromptPurchase(loser, itemId)
MarketPlaceService.PromptPurchaseFinished:Connect(function(loser, itemId, was_purchased)
if was_purchased then
loser.leaderstats.Donated.Value += itemPrice
local playerId = loser.UserId
game:GetService("TextChatService").TextChannels.RBXSystem:DisplaySystemMessage("[SYSTEM] "..loser.Name.." donated "..itemPrice.." robux to "..winnerName, "RBXSystem")
else
return
end
return
end)
return
end
for i,v in pairs(loser.PlayerGui.Donation.Frame.itemsScroller:GetChildren()) do
if not (v:IsA("TextButton") or v:IsA("ImageButton")) then continue end
v.MouseButton1Click:Connect(function()
donateButtonClicked(v)
end)
end
local exitButton = loser.PlayerGui.Donation.Frame.Exit
exitButton.MouseButton1Click:Connect(function()
loser.PlayerGui.Donation.Enabled = false
end)