General > Developers Corner
CURSE YOU SOUND
Golden-Death:
For monkeys sake, I've been fooling around with this for ages. No matter how I try to get a sound to play using lua, it doesnt work.
It works with 'play' in console.
It works in an old swep I made
but in this script, no matter what I try, it won't (@*# play.
--- Code: ---function PickRandSong()
GTMSongList = _file.Find( "sound/"..GTM.SongFolder.."*.mp3" );
GTMSongNum = table.getn(GTMSongList)
if GTMSongNum <= 3 then
local more = 4 - GTMSongNum
_PrintMessageAll(HUD_PRINTTALK, "You cant play with less than 4 songs! Add at least "..more.." more songs and try again.\n")
_PrintMessageAll(HUD_PRINTCONSOLE, "You cant play with less than 4 songs! Add at least "..more.." more songs and try again.\n")
return;
end
GTMSongPlayingNum = math.random(1,GTMSongNum)
_Msg("Picked: "..GTMSongPlayingNum.."\n")
_PlaySound( ""..GTM.SongFolder..GTMSongList[GTMSongPlayingNum].."\n")
_Msg( ""..GTM.SongFolder..GTMSongList[GTMSongPlayingNum].."\n")
end
--- End code ---
Golden-Death:
Perhaps this is an engine bug, it only works in SWEPS. Not even ulx playsound works.
Megiddo:
Are you trying to play mp3s?
JamminR:
--- Quote from: Megiddo ---Are you trying to play mp3s?
--- End quote ---
Answering for GD...
--- Code: ---GTMSongList = _file.Find( "sound/"..GTM.SongFolder.."*.mp3" );
--- End code ---
:D Yes
Golden-Death:
--- Quote from: Megiddo on October 30, 2006, 10:17:45 PM ---Are you trying to play mp3s?
--- End quote ---
Yes, but wavs do not work either.
Navigation
[0] Message Index
[#] Next page
Go to full version