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)
-- 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 given. <---------------
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 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 )
music.SoundId = 'rbxassetid://'..sounds[math.random(1,#sounds)]
music.Playing = true
info.Text = music.TimeLength
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() --Time of sound
info.Text = music.TimeLength..'s'
end)
music.Ended:Connect(function()
task.wait(1) -- (Can be changed) Pause between each audio
music.SoundId = 'rbxassetid://'..sounds[math.random(1,#sounds)]
music.Playing = true
end)
------------------------------------ Settings tab ------------------------------------
OpenSettings.MouseButton1Click:Connect(function()
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! (: