I am kind of new to deving and I really do Not know how to make this work or what is wrong with this .
local TextEntry = vgui.Create( "DTextEntry", qframe)
TextEntry:SetPos( 25, 80 )
TextEntry:SetSize( 300, 30 )
TextEntry:SetText( "Paste Url" )
TextEntry.OnEnter = function()
RunConsoleCommand("qmusic")
local url = TextEntry:GetValue() -- So basicaly when you hit enter it sets the varible url and runs console command. But this is not the issue
end
end
end
concommand.Add( "qmusic", function (station) sound.PlayURL ( url, "3d" --- this function is the issue, it will just not work.
if ( IsValid( station ) ) then
station:SetPos( LocalPlayer():GetPos() )
station:Play()
else
LocalPlayer():ChatPrint( "Invalid URL!" )
end
end ))
Please help, thx.