Hi everyone, I am trying to make GUI, for a radio, but the script isn’t working and I don’t know what’s wrong. I tested in both Studio and an actual game window and I get the same error.
This is the script, it always returns “Invalid or non-existing”
local textbox = script.Parent.Parent
local id = tonumber(textbox.Text)
if id then
local success, err = pcall(game:GetService("MarketplaceService"):GetProductInfo(id))
if success then
if game:GetService("MarketplaceService"):GetProductInfo(id).AssetType == 3 then
local args = "music-change"
game.ReplicatedStorage.VIPCommands:FireServer(id, args)
else
textbox.Text = ""
textbox.PlaceholderText = "ID is not a sound"
wait(2)
textbox.PlaceholderText = "Enter costum song ID here"
end
end
if err then
textbox.Text = ""
textbox.PlaceholderText = "Invalid or inexisting ID"
wait(2)
textbox.PlaceholderText = "Enter costum song ID here"
end
else
textbox.Text = ""
textbox.PlaceholderText = "ID must be a number"
wait(2)
textbox.PlaceholderText = "Enter costum song ID here"
end
end) ```