Jump to content
  • 0

[Help - Request] On enter play custom sound


Question

Posted

Hi guys could you help me with a java code which will play a custom sound when player logs in but wont reapeat! thanks

6 answers to this question

Recommended Posts

  • 0
Posted

Sounds are client side, not server.

but on enter char u need core side to use this effect, retail l2 client doesnt have it -.-
  • 0
Posted

As following :

benefactor.sendPacket(new PlaySound("package.sound"));

Where "benefactor" is the ppl who receives the sound, "package" is the package where the sound is stored, and "sound" is the name of the sound itself.

 

Then you can apply different rules, such as broadcastPacket (which will send to all ppl in a radius around the player), or even using Broadcast.java methods (to all players online, to all players in X radius, etc).

 

If benefactor is a NPC and you use sendPacket, nothing will happen. But if you broadcastPacket, it will send to all ppls around that NPC, and so there is a use.

 


 

About custom client ask itself, can't help here. Go on client section.

  • 0
Posted

As following :

benefactor.sendPacket(new PlaySound("package.sound"));

Where "benefactor" is the ppl who receives the sound, "package" is the package where the sound is stored, and "sound" is the name of the sound itself.

 

Then you can apply different rules, such as broadcastPacket (which will send to all ppl in a radius around the player), or even using Broadcast.java methods (to all players online, to all players in X radius, etc).

 

If benefactor is a NPC and you use sendPacket, nothing will happen. But if you broadcastPacket, it will send to all ppls around that NPC, and so there is a use.

 


 

About custom client ask itself, can't help here. Go on client section.

where should i work this code? EnterWorld? can u pass me the location pls.

Also will the sound repeat? cuz i want smth like when a player logs in custom sound plays once "WELCOME" or "pitbulll - lalala song"

  • 0
Posted

EnterWorld is eventually the good place, but you perhaps will have to delay it with a task (in all cases, put it at the top end). And no, no sound repetition.

 

About tasks (in case sound is played during loading screen), search ThreadPoolManager.

  • 0
Guest Elfocrash
Posted

I recommend you to add a delay for the playsound because places will trigger another "town sound" after your song is played so you will probably listen to the song for 2 seconds and then the town music will cover it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Lineage 2 Interlude Developer – Cliente + Datapack Hola, soy developer especializado en Lineage 2 Interlude con experiencia tanto en cliente como datapack/core. ✔ Desarrollo datapack (Java, scripts, quests, balance PvP/PvE) ✔ Fixes core / geodata / exploits ✔ Sistemas custom (events, Olympiad, instancias, mods PvP) ✔ Cliente: interface mods, system patches, .dat edits, UI personalizada ✔ Optimización y estabilidad de servidor ✔ Trabajo freelance o colaboración fija Si necesitáis soporte dev o mejoras para vuestro servidor Interlude, podéis contactarme por DM. Portfolio y ejemplos disponibles bajo petición.
    • THEY DON’T COME BACK FOR NO REASON. HERE’S WHY Our clients come from different countries and with very different tasks. But the strongest indicator of quality is simple — when a client comes back **for a second time**. This case is exactly that. The client returned with a request for a **German ID**. The requirement was clear: a document **in a male hand**, with a natural live scene and correct geographic context. What we did: ▪ accepted source files and data without unnecessary bureaucracy ▪ selected a **real street**, not a generic background ▪ built a print-ready mockup with correct scene logic ▪ sent it for approval ▪ after confirmation, delivered the **final file for printing** No templates. No “good enough”. Only solutions tailored to a specific task. Result: ▪ mockup approved on the first try ▪ client fully satisfied ▪ stays in touch We work **worldwide** — and that’s exactly why clients return. Contact us › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +6RAKokIn5ItmYjEx ) *All data is published with the client’s consent.* #redraw #verification #documents #case #ID
    • Lineage 2 Interlude Developer – Cliente + Datapack Hola, soy developer especializado en Lineage 2 Interlude con experiencia tanto en cliente como datapack/core. ✔ Desarrollo datapack (Java, scripts, quests, balance PvP/PvE) ✔ Fixes core / geodata / exploits ✔ Sistemas custom (events, Olympiad, instancias, mods PvP) ✔ Cliente: interface mods, system patches, .dat edits, UI personalizada ✔ Optimización y estabilidad de servidor ✔ Trabajo freelance o colaboración fija Si necesitáis soporte dev o mejoras para vuestro servidor Interlude, podéis contactarme por DM. Portfolio y ejemplos disponibles bajo petición.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..