I have made a code that when a developer product is purchased a ParticleEmitter will enable, but after 8 seconds as specified in the code down bellow with wait(8)
they will not disable and I don’t know what the issue is could be if someone knows what the issue may be I’d be very thankful.
local mps = game:GetService('MarketplaceService')
local Part = workspace.Part
local ProductIds = {
1245491084, -- 5
1245491700, -- 10
1245501862, -- 50
1245501902, -- 100
1245501989, -- 500
1245502049, -- 1000
1245502088, -- 5000
1245502138, -- 10000
}
game.Players.PlayerAdded:Connect(function(plr)
mps.PromptProductPurchaseFinished:Connect(function(UserId, productId, Succes)
for i, v in pairs(ProductIds) do
if productId == v and Succes == true then
print(plr.Name..' Has succesfully donated!')
for i, v in pairs(Part:GetChildren()) do
if v:isA('ParticleEmitter') then
v.Enabled = true
wait(8)
v.Enabled = false
end
end
end
end
end)
end)