local r = game:GetService('MarketplaceService')
local i = 702565986
local MarketPlaceService = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Click:Play()
r:PromptGamePassPurchase(game.Players.LocalPlayer, i)
end)
MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(x,e)
if e == 702565986 then
game.ReplicatedStorage.eee:FireServer('basicsuit', 0)
end
end)
If you could read the docs, the event fires when the user presses buy or cancel. Third parameter of the event is a boolean value that describes if the purchase was successful, so check if its true. Also your script is not secure at all, an exploiter could easily fire the event to get the basic suit