So, with all that in mind - your final code should look something like this: local snds=file. 1 Answer Sorted by: 0 Instead of relying on surface. You can do this by looping through the table and calling util.PrecacheSound(path) on them, like so: for k,v in pairs(snds) do I would also recommend precaching all the sounds. Make sure you create the table of sounds outside of the GM:PlayerFootstep function, so that it only runs once. Sign in 0:00 / 21:48 How to Create Addons and Update them for Garry's Mod's Workshop Wazanator 931 subscribers Subscribe 668 Share 45K views 4 years ago SourceEngine In this video, I go over. In your code, simply call local snds=file.Find( "sound/customsteps/*", "GAME" ) which gives you a table, then you can simply choose a random one from the list using local snd=snds and play it as you do in your above code - ply:EmitSound(snd). wav format for the sound files, but some others do work (. Get a Virtual Audio Cable, you can get a cracked on if you want. I'd recommend having a custom folder such as sound/customsteps/ where you can put all your custom sounds. You'll want to look at the file.Find function for this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |