1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Sound compatibility between minecraft versions

Discussion in 'Skript' started by PheonBest, Jun 22, 2017.

Thread Status:
Not open for further replies.
  1. PheonBest

    PheonBest Member

    Joined:
    Jun 8, 2017
    Messages:
    31
    Likes Received:
    1
    Hi !
    Server's version : 1.12 (spigot) Skript's version: dev29.
    I have a server which support 1.8 to 1.12 (with ViaVersion and ViaBackwards), that's why i'm wondering if I have to play the 1.8 version and the 1.12 version of a sound to be sure that all players will be able to hear it. Is there a compatibility between them ?

    Have I to do that for exemple ?:
    play sound "ui.button.click" with volume 1 with pitch 1 at player's location's location for player
    play sound "CLICK" with volume 1 with pitch 1 at player's location's location for player

    If it's needed, is there a way to know what's the client version of a player ?

    P-S: I hope my english isn't too bad :emoji_stuck_out_tongue:
     
  2. Best Answer:
    Post #2 by ShaneBee, Jun 25, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    You can use TuSKe to get a player's version:
    Code (Skript):
    1. (mc|minecraft) version of %player%
    2. %player%'[s] (mc|minecraft) version
    Sadly you will need to map yourself the sounds between 2 versions, but you can make a function to choose between two comparing player's version, an example:
    Code (Skript):
    1. function playSound(p: Player, oldSound: String, newSound: String):
    2.     if mc version of {_p} contains "1.8":
    3.         set {_sound} to {_oldSound}
    4.     else:
    5.         set {_sound} to {_newSound}
    6. play sound {_sound} with volume 1 with pitch 1 at {_p} for {_p}
    So just call it as:
    Code (Skript):
    1. playSound(player, "ui.button.click", "CLICK")
     
    • Like Like x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Thank you :emoji_slight_smile: I didn't know i could do that with TuSke !
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    You can also just play both sounds to 1 player
     
    • Agree Agree x 1
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Yes but it makes a little error ^^ (np i can chose a ressource pack according to mc version of %player% now :emoji_grinning:, this topic helps me anyway x)
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    So hit "best answer" to mark the topic as solved, so others can found it in future.
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...