Hello developers! I decided that I would make an audio player that has many useful features for fun.
This is my second resource!
You don’t have to credit me, but if you do, it would be greatly appreciated! (:
Preview:
You can remove the credit if you want
Video preview (“Effects” text is smaller than it is shown on the video)
print("Thank you for using the The Ultimate Audio Player!") -- You can remove this if you want.
-- IF YOU DO NOT CHANGE THE "MUST CHANGE", THE WHOLE SCRIPT WONT WORK.
-- Do not delete this script, the whole model wont work without it.
-- Made by yousefoyoy
-- If you want to change some stuff, only change if it has "(Can be changed)" next to the "--" NOTE: YOU CAN ONLY CHANGE STUFF IF YOU KNOW WHAT YOU'RE DOING.
-- You can change the icons if you want
-- -------------> "(Must change)" means that you have to change it based on the instructions givin. <---------------
local music = game.Workspace.Music_Player -- Make sure that the audio is in workspace
local muteANDunmute = script.Parent.MuteAndUnmute
local info = script.Parent.Info
local OpenSettings = script.Parent.Settings
local settings_tab = script.Parent.Parent.Setting_Menu
local song_id = script.Parent.Parent.Song_ID
local setting_options = {settings_tab.Loop,settings_tab.Song_ID,settings_tab.Effects,settings_tab.Play_Your_own_song} -- This contains all of the settings in the "setting tab"
local effect_tab = script.Parent.Parent.Effects_Tab
local your_music = script.Parent.Parent.Your_music
local service = game:GetService("MarketplaceService")
local pause_between_audios = script.Parent.Pause_between_audio
local remove_audio_ui = false -- (NOT LOCAL) If you want the audio player UI to be removed then make this true.
local pause_time = 1 -- (Can be changed)
local sounds = {???,???,???} -- -----> (Must change) <----- Place the songs/sounds you want to use here. (make sure you separate each id with a comma. Like this: 1234567,7654321 )
pause_between_audios.Value = pause_time
music.SoundId = 'rbxassetid://'..sounds[math.random(1,#sounds)]
music.Playing = true
local Start_Song_ID_Name = music.SoundId:match("%d+") -- Getting the name of the song
info.Text = service:GetProductInfo(Start_Song_ID_Name,Enum.InfoType.Asset).Name
if remove_audio_ui == true then
game.ReplicatedStorage.Audio_player_remoteEvent:FireServer()
end
----------------------------------------------------------------------------------------------------------------------
muteANDunmute.MouseButton1Click:Connect(function() -- Mute and unmute
if music.Volume == 0 then
music.Volume = 1
muteANDunmute.Image = 'rbxassetid://7072724897'-- (Can be changed) Changes Audio Icon
else
music.Volume = 0
muteANDunmute.Image = 'rbxassetid://7072724946'-- (Can be changed) Changes Audio Icon
end
end)
music:GetPropertyChangedSignal("TimeLength"):Connect(function() -- Getting the name of the song when song is changed
local Song_ID_Name = music.SoundId:match("%d+")
info.Text = service:GetProductInfo(Song_ID_Name,Enum.InfoType.Asset).Name
end)
music.Ended:Connect(function()
task.wait(pause_between_audios.Value)
music.SoundId = 'rbxassetid://'..sounds[math.random(1,#sounds)]
music.Playing = true
end)
------------------------------------ Settings tab ------------------------------------
OpenSettings.MouseButton1Click:Connect(function() -- Setting tab: Open and close
settings_tab.Visible = not settings_tab.Visible
end)
setting_options[1].ImageButton.MouseButton1Click:Connect(function() -- Loop setting
if setting_options[1].ImageButton.Image == 'rbxassetid://7072722963' then
setting_options[1].ImageButton.Image = 'rbxassetid://7072706576'
music.Looped = true
else
setting_options[1].ImageButton.Image = 'rbxassetid://7072722963'
music.Looped = false
end
end)
setting_options[2].ImageButton.MouseButton1Click:Connect(function() -- Show ID setting
if setting_options[2].ImageButton.Image == 'rbxassetid://7072722963' then
setting_options[2].ImageButton.Image = 'rbxassetid://7072706576'
song_id.Visible = true
else
setting_options[2].ImageButton.Image = 'rbxassetid://7072722963'
song_id.Visible = false
end
end)
setting_options[3].ImageButton.MouseButton1Click:Connect(function()
if setting_options[3].ImageButton.Image == 'rbxassetid://7072722963' then
setting_options[3].ImageButton.Image = 'rbxassetid://7072706576'
effect_tab.Visible = true
else
setting_options[3].ImageButton.Image = 'rbxassetid://7072722963'
effect_tab.Visible = false
end
end)
setting_options[4].ImageButton.MouseButton1Click:Connect(function()
if setting_options[4].ImageButton.Image == 'rbxassetid://7072722963' then
setting_options[4].ImageButton.Image = 'rbxassetid://7072706576'
your_music.Visible = true
else
setting_options[4].ImageButton.Image = 'rbxassetid://7072722963'
your_music.Visible = false
end
end)
The main script (Contains instructions)
- Yes
- No
- I don’t need an audio player
0 voters
- 1
- 2
- 3
- 4
- 5
0 voters
If you have any suggestions, bug reports or you just want to give your opinion, feel free to post it in the comments below! (: