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
#Gamepass prompt keeps getting prompted
5 messages · Page 1 of 1 (latest)
I believe it keeps prompting the gamepass due to the while IsAutoHatching == true at the top
@edgy sable yes you're right, you can fix this by just adding a debounce or yield when it's prompting
Perfect it works, I knew it was something to do with that part I was just brain dead from all the coding and thinking I was trying to do before hand haha. Thanks.
eh could be worse, I've helped people debug so much that sometimes when I want to start scripting my own scripts again my brain just wants to turn off