Nuke firing script does not work

I used a free model to try to make a nuke fire upon the player purchasing a dev product, but it does not work. The script is as follows:

-- Fun nuke by berezaa
-- Credit to FriendlyBiscuit/eric for uploading the loopable alarm sound for me

wait(1)

script.Parent.Missle.Base.Anchored = true
local MarketplaceService = game:GetService("MarketplaceService")


debounce = false

script.Parent.Button.ClickDetector.MouseClick:connect(function(plr)
	
	if debounce == false then
		game:GetService("MarketplaceService"):PromptProductPurchase(plr,1189664828)
		game.ReplicatedStorage.FireNuke.Event:Wait()
		debounce = true
		
		script.Parent.Button.Sound:Play()
		
		local siren = script.Parent.Button.Siren
		siren.Parent = workspace
		siren:Play()
		
		coroutine.resume(coroutine.create(function()
			local lights = script.Parent.Lights:GetChildren()
			for i=1,100 do
				for i,v in pairs(lights) do
					v.SpotLight.Enabled = true
				end
				wait(0.54)
				for i,v in pairs(lights) do
					v.SpotLight.Enabled = false
				end
				wait(0.54)			
			end
		end))
		
		wait(2)
		
		script.Parent.Missle.Base.Fire.Enabled = true
		script.Parent.Missle.Base.Smoke.Enabled = true
		
		wait(3)
		
		script.Parent.Missle.PrimaryPart = script.Parent.Missle.Base	
		for i=1,320 do
			script.Parent.Missle:SetPrimaryPartCFrame(script.Parent.Missle:GetPrimaryPartCFrame()+Vector3.new(0,0.05*((1.1^(i/5))/3),0))
			wait()
		end
		wait()
		for i=1,100 do
			script.Parent.Missle:SetPrimaryPartCFrame(script.Parent.Missle:GetPrimaryPartCFrame()+Vector3.new(0,0.05*(1.1^((250-i)/5)/3),0))
				script.Parent.Missle:SetPrimaryPartCFrame(script.Parent.Missle:GetPrimaryPartCFrame()*CFrame.Angles(0,math.pi/100,0))
				script.Parent.Missle:SetPrimaryPartCFrame(script.Parent.Missle:GetPrimaryPartCFrame()+Vector3.new(0,0,-i/100))	
			wait()
		end
		wait()
		for i=200,120,-1 do
			script.Parent.Missle:SetPrimaryPartCFrame(script.Parent.Missle:GetPrimaryPartCFrame()-Vector3.new(0,0.1*((1.1^(i/2.95))/4),0))
			wait()
		end	
		
		script.Parent.Missle.Tip.Transparency = 0.5
		script.Parent.Missle.Tip.CanCollide = false
		script.Parent.Missle.Tip.Mesh.Scale = Vector3.new(1,1,1)
		local boom = script.Parent.Button.Boom
		boom.Parent=workspace
		boom:Play()
		local frame = script.Parent.Missle.Tip.CFrame
		
		script.Parent.Missle.Tip.Boom.Disabled = false	
		
		for i=1,400 do
			script.Parent.Missle.Tip.Size=script.Parent.Missle.Tip.Size+Vector3.new(3,3,3)
			script.Parent.Missle.Tip.CFrame=frame
			wait()
		end
		script.Parent.Missle.Tip.Boom.Disabled=true
		script.Parent.Missle:Destroy()
		siren:Stop()
		boom:Stop()
		
		
	end
end)
MarketplaceService.PromptPurchaseFinished:Connect(function(player, assetId, isPurchased)
	print("event should be fired?")
	if assetId == 1189664828 then
		if isPurchased == true then
			game.ReplicatedStorage.FireNuke:Fire()
		end
	end
end)

It does prompt the purchase, but it does not fire, even after I buy it. Nor does it print “event should be fired?”.

Maybe game.ReplicatedStorage.FireNuke.Event:Wait() is causing the problem?

Well I believe this is what is causing it:

		game.ReplicatedStorage.FireNuke.Event:Wait()

It’s completely pausing the script so the other parts in the script don’t start. Use a seperate script to handle the event firing and developer product processing.

So just copy and paste this into a different server script.

MarketplaceService.PromptPurchaseFinished:Connect(function(player, assetId, isPurchased)
	print("event should be fired?")
	if assetId == 1189664828 then
		if isPurchased == true then
			game.ReplicatedStorage.FireNuke:Fire()
		end
	end
end)

The event is actually called “PromptProductPurchaseFinished”, not “PromptPurchaseFinished”.