im trying to make it that when you buy the gamepass you can use the auto click for the simulator, it works but it doesnt save for some reason pls help
script:
``local hasBought = false
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, passId, wasPurchased)
if plr == player and passId == GamepassID and wasPurchased then
hasBought = true
end
end)
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
hasBought = true
end
button.MouseButton1Click:Connect(function()
if not hasBought then
print("ok2")
MarketplaceService:PromptGamePassPurchase(player, GamepassID)
else
if not enabled then
enabled = true
running = true
frame.BackgroundColor3 = Color3.new(0, 1, 0)
if coinImageScript and slowClickScript then
slowClickScript.Enabled = false
coinImageScript.Enabled = false
end
startCoinLoop()
else
enabled = false
running = false
frame.BackgroundColor3 = Color3.new(1, 0, 0)
if coinImageScript and slowClickScript then
slowClickScript.Enabled = true
coinImageScript.Enabled = true
end
end
end
end)``
Pls help me