ULX

Author Topic: Help needed with ulx playsound  (Read 1806 times)

0 Members and 1 Guest are viewing this topic.

Offline Charlie

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Help needed with ulx playsound
« on: July 19, 2020, 09:03:11 PM »
Hello, I am having issues with trying to get the ulx playsound command to work. I've looked at other threads and posts regarding this issue any I still haven't got it to work.
So, I have a sound file "loose.mp3" and have placed it in garrysmod/sound/fun/loose.mp3 .
I've added the
Code: [Select]
resource.AddFile("/sound/fun/loose.mp3") line into garrysmod/autorun/workshop.lua

I'm really not sure what I am doing wrong here, any help will be appreciated.

Thanks!

-----

My ULib/ULX versions are:
ULib v2.63w
ULX v3.73w

Game mode(s) I am having this problem on: Sandbox

What appears in the console:
Code: [Select]
] ulx playsound fun/loose.mp3
[LC ULib ERROR] Received invalid sound

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Help needed with ulx playsound
« Reply #1 on: July 20, 2020, 11:21:14 AM »
Remove the slash before "sound".

Code: [Select]
resource.AddFile("sound/fun/loose.mp3")
This line goes in garrysmod/lua/autorun/server/workshop.lua
« Last Edit: July 20, 2020, 11:23:06 AM by Timmy »

Offline Charlie

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Help needed with ulx playsound
« Reply #2 on: July 20, 2020, 04:36:49 PM »
Hello, I have tried all the things you have suggested but I am still getting the same error

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Help needed with ulx playsound
« Reply #3 on: July 22, 2020, 11:44:50 AM »
Interesting. The error implies that the sound file is still not being sent to you.

Make sure your game client downloads custom content. In the game menu: click "Options", click the "Multiplayer" tab, select "Allow all custom files from server" from the dropdown.



ULX also provides an alternative method to add files for download:
  • Shut down your server.
  • Open <garrysmod>/data/ulx/downloads.txt with Notepad or a code editor.
  • Add sound/fun/loose.mp3 on a new line.
  • Save the file.
  • Restart your server.