• Join Server & Play Sound
    8 replies, posted
Hi guys! I need something to my server. I want a script that makes this: - When a player join the server, he hear a custom sound. Only this. Thanks so much! I know how to make this: - When player join the server, show to him a message. This is that script: [CODE]-- Code to show a message to a player, when he joins the server function Spawn ( ply ) ply:PrintMessage (HUD_PRINTTALK, "Welcome " .. ply:Nick () .. ", enjoy with us!") end hook.Add( "PlayerSpawn", "spawnmessage", Spawn )[/CODE]
You'll have to [URL="http://wiki.garrysmod.com/page/Net_Library_Usage"]network it[/URL] clientside and use this function: [url]http://wiki.garrysmod.com/page/surface/PlaySound[/url]
[QUOTE=code_gs;47615153]You'll have to [URL="http://wiki.garrysmod.com/page/Net_Library_Usage"]network it[/URL] clientside and use this function: [url]http://wiki.garrysmod.com/page/surface/PlaySound[/url][/QUOTE] No need to network it, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/InitPostEntity]GM/InitPostEntity[/url] clientside should do.
[QUOTE=StonedPenguin;47615167]No need to network it, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/InitPostEntity]GM/InitPostEntity[/url] clientside should do.[/QUOTE] Too early; player will still be on the loading screen and will not hear it
[QUOTE=code_gs;47615179]Too early; player will still be on the loading screen and will not hear it[/QUOTE] [url]http://wiki.garrysmod.com/page/Category:timer[/url]
[QUOTE=StonedPenguin;47615185][url]http://wiki.garrysmod.com/page/Category:timer[/url][/QUOTE] Or just put it in PlayerInitalSpawn and avoid the hacky guess times.
[QUOTE=code_gs;47615207]Or just put it in PlayerInitalSpawn and avoid the hacky guess times.[/QUOTE] PlayerInitalSpawn is called before the player entity is created and would cause the same issue
[QUOTE=StonedPenguin;47615211]PlayerInitalSpawn is called before the player entity is created and would cause the same issue[/QUOTE] Not if the player hasn't selected a team/spawned; depends totally on the gamemode.
The gamemode it's for Trouble in Terrorist Town. When the people see the Motd (for example). I'm not a coder, can you make a script? Thanks for reply!
Sorry, you need to Log In to post a reply to this thread.