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 our 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.

I need help with simple Skript

Discussion in 'Skript' started by Noahrobs, Jul 13, 2017.

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

    Noahrobs Member

    Joined:
    Jul 13, 2017
    Messages:
    12
    Likes Received:
    0
    on rightclick:
    if player is holding a diamond:
    if player is in world "Game2":
    play sound

    I started this script not knowing how to finish it, i searched tutorials up on yt but no use.
    how would I make it so when I right click a diamond it plays sound by all nearby players except the person who clicked it.. if thats too advanced when right click named item scare all nearby enemies.. Im using 1.8.8 btw for testing purposes. xD
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. on right click:
    2.     if player is holding diamond:
    3.         if world is "world_nether":
    4.             play "ENTITY_PLAYER_LEVELUP" to player with volume 1 and pitch 2
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    I mean that'll only be for that player, how could I put it so it effects all nearby players like @a[r=5]
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. on rightclick:
    2.     if player is holding diamond:
    3.         if player is in world "Game2":
    4.             play sound "ENTITY_PLAYER_LEVELUP" at player's location with volume 1 and pitch 1
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    you would just loop the players in the desired radius, then play the sound at them using "loop-player" instead of player like this
    Code (Skript):
    1. on right click:
    2.     if player is holding diamond:
    3.         if world is "world_nether":
    4.         loop players is radius 10:
    5.             play "ENTITY_PLAYER_LEVELUP" to loop-player with volume 1 and pitch 2
     
    • Like Like x 1
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    So close its just it says "Players in radius 10 is not an entity type".. thanks so much for the help btw means alot :emoji_wink:
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Code (Skript):
    1. loop players in radius 10 around player:
     
    • Like Like x 1
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    That may need to be loop all players in radius 10 of player: instead
     
Thread Status:
Not open for further replies.
Loading...