Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Audio deleted detection not functioning as intended?

Asked by 3 years ago

I am making it so a player can play their own music on a big boombox. Except it keeps thinking that the audio is deleted. Is there any suggested script on what I should use?

local mps = game:GetService('MarketplaceService')
local audiotest = game:GetService("ReplicatedStorage"):WaitForChild('audiotest')
script.Parent.MouseButton1Click:Connect(function()
    local plr = script.Parent.Parent.Parent.Parent.Parent
    audiotest.SoundId = tonumber(script.Parent.Parent.audioid.Text)
    if audiotest.TimeLength == 0 then script.Parent.Parent.text.Text = "Error: Audio deleted or doesn't exist" wait(5) script.Parent.Parent.text.Text = "Play music on the rainbow boombox!" return end
    if audiotest.TimeLength >= 5.0001 then script.Parent.Parent.text.Text = "Error: Audio can't be longer than 5 minutes!" wait(5) script.Parent.Parent.text.Text = "Play music on the rainbow boombox!" return end
    mps:PromptProductPurchase(plr,1143378033)
end)

Answer this question