I want it to make the button get destroyed but it isn't working.
local gamepass = 10384087
local marketplace = game:GetService("MarketplaceService")
function yes()
local Player = game.Players.LocalPlayer
if marketplace:PlayerOwnsAsset(Player, gamepass) then
script.Parent.Parent.Parent.KF.CH2:Destroy()
end
end
script.Parent.MouseButton1Click:Connect(yes)
Please help!!

1 comment
Thank you!!