#Gamepass prompt keeps getting prompted

5 messages · Page 1 of 1 (latest)

edgy sable
#
if canHatch == true then
                IsAutoHatching = true
                while IsAutoHatching == true do
                    local result = replicatedStorage:WaitForChild("EggHatchingRemotes"):WaitForChild("AutoOpen"):InvokeServer(nearestEgg)

                    if result ~= "Cannot Hatch" and result ~= "The player does not own the gamepass" and Common.True.Value ~= true and Rare.True.Value ~= true and Legendary.True.Value ~= true and Mythic.True.Value ~= true then
                        if not cooldown then
                            stopAutoHatching.Visible = true
                            isHatching = false    
                            cooldown = true
                            hatchOne(result, nearestEgg)    
                            wait(.1)
                            cooldown = false
                            game.Workspace.Events.AddOneStorage:FireServer()
                        end

                    elseif result == "The player does not own the gamepass" then
                        nps:PromptGamePassPurchase(player, AutoHatchID)
                    end
                    if IsAutoHatching == false then
                        break
                    end
                end
            end
        end
    end
#

I believe it keeps prompting the gamepass due to the while IsAutoHatching == true at the top

civic jasper
#

@edgy sable yes you're right, you can fix this by just adding a debounce or yield when it's prompting

edgy sable
civic jasper