Jukebox

need jukebox same fromt sassillization player dont need download all song im have good web site for store song need more info reply plz

Er I’m 97% sure you can do this with wiremod.

No, it’s lua coded script, not a wire creation.

Edit:

need jukebox same fromt sassillization player dont need download all song im have good web site for store song need more info reply plz
“I need a Jukebox, similiar from Sassilization server, I don’t need to download all songs, I have a good web site for storing the songs. Need more information, reply please.”

Feel free to modify this, just give me credit where due.


/*
		============================
Product: Music player ^_^
Author : ¦FlapJack¦
Thanks to -- Chrisaster , Stoned
Version: 0.9
		============================
*/


local Contents = {}
local LineTable =	{}

Video = vgui.Create("HTML")
Video:SetVisible(false) 
Video:OpenURL("http://google.com/")

LineTable[1] = { Name = "Caramell Dansen Remix", Length = "2:57", URL = "http://www.youtube.com/watch?v=arOOQCJsvhY" }
LineTable[2] = { Name = "The Day That Never Comes", Length = "8:25", URL = "http://www.youtube.com/watch?v=5KAIJmxob-o" }
LineTable[3] = { Name = "Still Alive - Portal", Length = "3:05", URL = "http://www.youtube.com/watch?v=Y6ljFaKRTrI" }
LineTable[4] = { Name = "What Is Love? - Haddaway", Length = "4:04", URL = "http://www.youtube.com/watch?v=nsCXZczTQXo" }
LineTable[5] = { Name = "Smells like Teen Spirit - Nirvana" , Length = "4:56" , URL = "http://www.youtube.com/watch?v=kPQR-OsH0RQ"}
LineTable[6] = { Name = "Rape Me - Nirvana" , Length = "2:51" , URL = "http://www.youtube.com/watch?v=psvCUWzecGo"}
LineTable[7] = { Name = "Jonny Sniper - Enter Shikari" , Length = "4:28" , URL = "http://www.youtube.com/watch?v=dWbJKOThJAg"}
LineTable[8] = { Name = "Sorry You're not a Winner - Enter Shikari" , Length = "4:07" , URL = "http://www.youtube.com/watch?v=P4MiC67seUY"}
LineTable[9] = { Name = "When I Come Around  - Green Day" , Length = "2:57" , URL = "http://www.youtube.com/watch?v=imNJntb-qkA"}
LineTable[10] = { Name = "So we're named after Saints? - The Yashin" , Length = "5:56" , URL = "http://www.youtube.com/watch?v=1BupWiORPd0"}
LineTable[11] = { Name = "First rule of the Fight Club - The Yashin" , Length = "6:37" , URL = "http://www.youtube.com/watch?v=NfARPIjlVRg"}
LineTable[12] = { Name = "Pulmonary Archery - Alexisonfire" , Length = "2:33" , URL = "http://www.youtube.com/watch?v=e9jdZvAPBT0"}
LineTable[13] = { Name = "Kickapoo - Tenacious D" , Length = "4:13" , URL = "http://www.youtube.com/watch?v=WRiyefjc4Xo"}
LineTable[14] = { Name = "Fuck her Gently - Tenacious D" , Length = "2:02" , URL = "http://www.youtube.com/watch?v=DCKQ3ZNkivY"}
LineTable[15] = { Name = "Prayer of the Refugee" , Length = "3:29" , URL = "http://www.youtube.com/watch?v=pOtNqDyyX2c"}
LineTable[16] = { Name = "One - Metallica" , Length = "7:47" , URL = "http://www.youtube.com/watch?v=vdlfN18zKYc"}
LineTable[17] = { Name = "Through Fire and Flames - Dragonforce" , Length = "7:56" , URL = "http://www.youtube.com/watch?v=iFxq2e7H1tg"}
LineTable[18] = { Name = "Enter Sandman - Metallica" , Length = "5:27" , URL = "http://www.youtube.com/watch?v=aUUEjd6vrOQ"}
LineTable[19] = { Name = "Minority - Green Day" , Length = "2:48" , URL = "http://www.youtube.com/watch?v=9S-6IIumMLs"}
LineTable[20] = { Name = "Basket Case - Green Day" , Length = "2:56" , URL = "http://www.youtube.com/watch?v=GTwJo0HeNmU"}

function MusicFrame(ply,cmd,arg)		
	MusicMain = vgui.Create( "DFrame" )
	MusicMain:SetSize( 550, 550 )
	MusicMain:Center()
	MusicMain:SetTitle( "MusicPlayer" )
	MusicMain:SetVisible( true )
	MusicMain:SetDraggable( true )
	MusicMain:ShowCloseButton( true )
	MusicMain:MakePopup()

	local MusicSheet = vgui.Create( "DPropertySheet" )
	MusicSheet:SetParent(MusicMain)
	MusicSheet:SetPos(30 , 30 )
	MusicSheet:SetSize( 480, 480 )
	
	local DList = vgui.Create( "DPanel", MusicSheet )
	DList:SetSize( ScrW()-20, ScrH()-45 )
	DList.Paint = function()
		surface.SetDrawColor( 171, 171, 171, 255 )
		surface.DrawRect( 0, 0, DList:GetWide(), DList:GetTall() )
	end
	
	local Custom = vgui.Create( "DPanel", MusicSheet )
	Custom:SetSize( ScrW()-20, ScrH()-45 )
	Custom.Paint = function()
		surface.SetDrawColor( 171, 171, 171, 255 )
		surface.DrawRect( 0, 0, DList:GetWide(), DList:GetTall() )
	end

	MusicSheet:AddSheet( "Pre-set Awesomeness", DList, "gui/silkicons/user", false, false, "Pre-set Awesomeness" )
	MusicSheet:AddSheet( "Custom Stuff", Custom, "gui/silkicons/user", false, false, "Custom Stuff" )
	
	local MusicList = vgui.Create("DListView")
	MusicList:SetParent(DList)
	MusicList:SetPos(25, 50)
	MusicList:SetSize(350, 350)
	MusicList:SetMultiSelect(false)
	MusicList:AddColumn("Song")
	MusicList:AddColumn("Length")
	for index, value in pairs(LineTable) do
		MusicList:AddLine(value.Name, value.Length)
	end
	
	CustomURL = vgui.Create("DTextEntry")
	CustomURL:SetParent(DList)
	CustomURL:SetSize(250 , 30)
	CustomURL:SetPos(25 , 400)
	CustomURL:SetText("Enter a custom URL")
	CustomURL.OnEnter = function()
			CustURL = CustomURL:GetValue()  
			Video:SetHTML("")  
			Video:OpenURL(CustURL)  
	end
	


	PlayButton = vgui.Create("DButton", DList)
	PlayButton:SetSize( 50, 50 )
	PlayButton:SetPos( 400, 80 )
	PlayButton:SetText("Play")
	PlayButton.DoClick = function()
		local theSong = MusicList:GetLine(MusicList:GetSelectedLine()):GetValue(1)
		for k, v in pairs(LineTable) do
				if v.Name == theSong then  
					theLink = v.URL  
					Video:OpenURL(theLink)  
					MusicMain:Close()  
				break
			end		
		end
	end
	
	StopButton = vgui.Create("DButton" , DList)
	StopButton:SetSize(50 , 50)
	StopButton:SetPos(400 , 130)
	StopButton:SetText("Stop")
	StopButton.DoClick = function()
	Video:SetHTML("http://www.google.com/")
	end
	
	SName = vgui.Create("DTextEntry" , Custom)
	SName:SetSize(120 , 25)
	SName:SetPos(25 , 25)
	SName:SetText("Enter the song name")
	SName.OnEnter = function()
		SavedName = SName:GetValue()
	end
	
	SLength = vgui.Create("DTextEntry" , Custom)
	SLength:SetSize(120 , 25)
	SLength:SetPos(145, 25)
	SLength:SetText("Enter song length")
	SLength.OnEnter = function()
		SavedLength = SLength:GetValue()
	end
	
	SURL = vgui.Create("DTextEntry" , Custom)
	SURL:SetSize(120 , 25)
	SURL:SetPos(265 , 25)
	SURL:SetText("Enter song URL")
	SURL.OnEnter = function()
		SavedURL = SURL:GetValue()
	end
	
	SaveButton = vgui.Create("DButton")
	SaveButton:SetParent(Custom)
	SaveButton:SetSize(250 , 30)
	SaveButton:SetPos(25 , 400)
	SaveButton:SetText("Enter in data for text entry fields, then click")
	SaveButton.DoClick = function()
			SData = SavedName.."|"..SavedLength.."|".. SavedURL
			print(SData)
			if !(file.Exists("flapplayer.txt")) then file.Write("flapplayer.txt", "") end
			local oldfile = file.Read("flapplayer.txt")
			file.Write("flapplayer.txt" , oldfile.."
"..SData)
	end
	
	local SvMusicList = vgui.Create("DListView")
	SvMusicList:SetParent(Custom)
	SvMusicList:SetPos(25, 50)
	SvMusicList:SetSize(350, 350)
	SvMusicList:SetMultiSelect(false)
	SvMusicList:AddColumn("Song")
	SvMusicList:AddColumn("Length")
	for i,v in pairs(string.Explode("
",(file.Read("flapplayer.txt")))) do
		local tbl = string.Explode("|",v)
		print(#tbl)
    	SvMusicList:AddLine(tbl[1] , tbl[2])
	end

		SvPlayButton = vgui.Create("DButton")
		SvPlayButton:SetParent(Custom)
		SvPlayButton:SetSize(40 , 40)
		SvPlayButton:SetPos(400 , 80)
		SvPlayButton:SetText("Play")
		SvPlayButton.DoClick = function()
				local SvtheSong = SvMusicList:GetLine(SvMusicList:GetSelectedLine()):GetValue(1)
				for k, v in pairs(string.Explode("
",file.Read("flapplayer.txt"))) do
				if string.Explode("|",v)[1] == SvtheSong then  
					theLink = string.Explode("|",v)[3]
					Video:OpenURL(theLink)  
					MusicMain:Close()  
				break
				end
			end		
		end
	end
concommand.Add("MusicMenu", MusicFrame)


How can I play those songs, there isn’t a button which toggles the menu.

Sorry for bump, but does this work only in singleplayer? I tried creating an online server but it just says “Unknown command MusicMenu”

Will work as long as:

A) The server does not have scriptenforcer enabled
B) The script is running

I might code (And possibly release) a working one with server and client parts (For epic win)

I’m going to ensure that A.

Edit:

Scriptenforcer was on, works now on listen server.

Is this only clientside? My friend said he did not hear anything when I played a song.

I am new at coding lua, but i would really like this to work :slight_smile: Can you tell me the path where i should put this, after i pasted it to a .lua file?

EDIT:

I have placed it at garrysmod/garrysmod/gamemodes/sandbox/gamemodes/jukebox.lua and i have added the following line to cl_init.lua;


include( 'jukebox.lua' )

and of course, i run sandbox gamemode.

What did i do wrong?

nvm