So, I am trying to play sound on when a round starts.
The sound is located in garrysmod/sound/Welcome.wma
Here is the code
ROUND_WAITING = 0 ROUND_PREPARING = 1 ROUND_ACTIVE = 2 ROUND_ENDING = 3 AddCSLuaFile() -- Send the file to the client. hook.Add( "OnRoundSet", "Round Set Example", function( round, winner ) if round == ROUND_WAITING then print( "We're waiting for the game to start!" ) elseif round == ROUND_PREPARING then print( "The round is preparing!" ) **surface.PlaySound( "/sound/Welcome.wma" )** elseif round == ROUND_ACTIVE then print( "Let's play!" ) elseif round == ROUND_ENDING then print( "The winner is "..winner.."!" ) -- If the winner is the timelimit, it will be the number 123. if winner != 123 then print( team.GetName(winner).." is awesome!" ) end end end )
But I get ‘gmod surface a nil value’ why do I get it? The file is sv_round.lua part of the Deathrun gamemode.
I am starting to think /sound/Welcome.wma but were does PlaySound point to by default?