You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I need to fix an error with my music system because the time tween just quits mid way.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub? yes
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
--// Code here \\--
-- Music ui handler --
local TweenService = game:GetService('TweenService')
--// Gets name of the sound id \\--
local Getname = function(SoundId)
local Market = game:GetService('MarketplaceService')
local Info = Market:GetProductInfo(SoundId)
return Info.Name
end
--// Get's fixed size (Primarily used in the progressbar \\--
local GetFixedSize = function(TimePos, TimeLen)
return UDim2.new(TimePos / TimeLen, 0,1,0)
end
--// Formats name so it looks better \\--
local FormatName = function(Name)
local Pattern_1 = "%(.-%)"
local Pattern_2 = "%[.-%]"
local Pattern_3 = "{.-}"
local Constructed = ""
if(Name:match(Pattern_1))then
Constructed = Name:gsub(Name:match(Pattern_1),"")
else
Constructed = Name
end
if(Constructed:match(Pattern_2))then
Constructed = Constructed:gsub(Constructed:match(Pattern_2),"")
else
Constructed = Constructed
end
if(Constructed:match(Pattern_3))then
Constructed = Constructed:gsub(Constructed:match(Pattern_3),"")
else
Constructed = Constructed
end
Constructed = Constructed:gsub("%(","")
Constructed = Constructed:gsub("%)","")
Constructed = Constructed:gsub("{","")
Constructed = Constructed:gsub("}","")
Constructed = Constructed:gsub("%[","")
Constructed = Constructed:gsub("%]","")
return Constructed
end
local Bar = script.Parent.Progressbar.Inner
local Len = script.Parent.Len
local Pos = script.Parent.Pos
local DisplayName = script.Parent.Display_Name
local Toggled = false
local Toggler = script.Parent.Toggle
local StartY = -0.109
local AfterY = -0.069
local OldPos = script.Parent.Position
Toggler.MouseButton1Click:Connect(function()
if(Toggled)then
local Tween = TweenService:Create(Toggler, TweenInfo.new(.5), {Rotation = -90})
script.Parent:TweenPosition(OldPos + UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
Tween:Play()
Toggled = false
else
local Tween = TweenService:Create(Toggler, TweenInfo.new(.5), {Rotation = 90})
script.Parent:TweenPosition(OldPos - UDim2.new(0,0,0.035,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
Tween:Play()
Toggled = true
end
end)
while wait() do
repeat wait() until workspace.MainMusic.IsPlaying == true
local MusicP = workspace.MainMusic
local ProductId = MusicP.SoundId:gsub("rbxassetid://","")
DisplayName.Text = FormatName(Getname(tonumber(ProductId)))
Bar.Size = GetFixedSize(MusicP.TimePosition, MusicP.TimeLength)
Len.Text = string.format("%d:%02d", MusicP.TimeLength / 60 % 60, MusicP.TimeLength % 60)
Pos.Text = string.format("%d:%02d", MusicP.TimePosition / 60 % 60, MusicP.TimePosition % 60)
end
-- End of code
end)()
end)
end)
end)()
return OwO
end)
return "Function"
Here’s my code, I’m getting an MarketplaceService:getProductInfo() failed because HTTP 429 error and i’m confused on how to fix it.