Resource icon
This content may be freely modified and/or maintained by anyone.

Icezer

Local Ice Cube Frien. Robotic Hedgehog Enthusiast.
After working on console and command related scripting for a few hours, I bring you JoinSFX!

JoinSFX is a script that simply plays a sound whenever a player joins a server. However, that's only the tip of the iceberg.



The sound effect can actually be picked from a list of several different ones that have been coded into the script.


A whole 25 different sound effects are available in this first version, along with a built in default option to disable the join sound outright.


It is also worth mentioning that this script's command is server host exclusive. This means that if you are hosting a server and a normal player tries to use the command, they'll be told of the host requirement instead of being able to see the list, set the sound, etc.


The only quirk at the moment, though, is that rejointimeout is currently not supported by this script. Until the hook handling player rejoins is uncovered, no sound will play for players returning to a server with rejointimeout active.


Only one new command is added, but it has a few arguments to note;


"joinsfx" is said new command, and the arguments are as follows:
nothing/"help" - Will give the user a quick rundown of how to get started.
"list" - Will print a list of applicable SFX in the console.
SFX name - Will set the join SFX to the chosen sound if it is available from the list.


All that being said, enjoy JoinSFX!

Changelog:
v1 - Initial release, 25 sounds.
v2 - Change to .pk3 format, 6 custom sounds added. 32 sounds.
v2.1 - Adjusted volume of some sounds, added 1 custom sound. 33 sounds.
 

Attachments

  • giphy.gif
    giphy.gif
    213.9 KB · Views: 590
  • VL_JoinSFX-v2.1.pk3
    1.3 MB · Views: 528
Last edited:
Made a quick addition to the script before fixing up the original post. I hope everyone enjoys this, and feels free to suggest sound effects to include in future updates!
 
JoinSFX Should be in the vanilla multiplayer experience! Hoping for this to be in 2.2.3 / 2.2.4 or something. I mean I'm actually surprised this isn't in, considering how good this is. Thank you.
 
The v2 update of JoinSFX is live! One sound from the vanilla game was added, but we also switched from .lua to .pk3, meaning custom sounds are now possible. 6 custom sounds are currently included, and that number will only grow from here. Enjoy, everybody!
 
The v2.1 hotfix is out. Fixed the volume of certain SFX and added 1 new custom sound.
 
@Icezer Hey, I know this is a very old addon but I recently tried it out.
I love the effects, but there's a strange issue. For some reason you iterated the console prints through every single player online???
Not only does this flood everyone's consoles with text, but it also renders it impossible for a dedicated server to see the command instructions (servers aren't included in players.iterate).
I went ahead and fixed the issue, I hope you can update the addon with this file. Seeing as this is a reusable addon, I assume this much is ok.
Don't credit me, all I did was remove two lines and organized the spacing. Anyone could have done it.
 

Attachments

  • VL_JoinSFX-v2.2.pk3
    1.3 MB · Views: 88
Sorry for the annoyance again @Icezer but I decided to go a step further.
I got rid of all those if else checks in favor of using a table to handle sound data, that way it's way easier to just insert sounds without messing with the command function directly and the code will run more efficiently.
I also put the console prints in a separate function for organization's sake.
I put a bit of effort in figuring this out and I'm really happy with the changes. I hope more servers (and you) can make use of this to play whatever sounds you'd like with ease!
If you think it's worth it, please feel free to take this file!
 

Attachments

  • VL_JoinSFX-v2.3.pk3
    1.3 MB · Views: 81

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top