this is a script that i've been posting all day. I finally went to add a gamepass checker to it and now it wont work
local PassId = 4835177
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local BloxyCola = ReplicatedStorage:WaitForChild("????? ???? ???")
local player = game.Players.LocalPlayer
local bloxy = workspace:WaitForChild("itemgiver1")
local debounce = false
bloxy.ClickDetector.MouseClick:Connect(function(player)
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, PassId) then --if they have the gamepass
if not debounce then
debounce = true
BloxyCola:Clone().Parent = player.Backpack
bloxy.ClickDetector.MaxActivationDistance=0
bloxy.Transparency=1
for i = 60, 1, -1 do -- give it a 60 second cooldown and show the timer
bloxy.BillboardGui.TextBox.Text = tostring(i)
wait(1)
end
script.Parent.ClickDetector.MaxActivationDistance=10
bloxy.BillboardGui.TextBox.Text=(" ") --replaces text and resets everything back to normal
bloxy.Transparency = 0
debounce = false -- allow the script to be run again
else
MarketplaceService:PromptPurchase(player, PassId) --if they dont have the gamepass ask them to buy it
end
end
end)
how could I fix this? I don't see any red lines under anything so I'm not sure where it's falling apart

4 comments
ty so much. you helped me a ton throughout this script and it wouldn't exist w/o you! :)(you basically made it)
hey, I have another question. Why wont my else statement work?
Because it's inside the "if not debounce then" if statement.
is there a way that i could use debounce/disable the script if i dont use that statment