Even if cancel the robux payment window, my script's buy the gamepass

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)

What should I do

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

Does changing the script to a server solve the safety problem?

Yes check the gamepass purchase on the server

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.