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 Messaging all the players in a world

Discussion in 'Skript' started by JackyBoy, Feb 4, 2017.

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

    JackyBoy Member

    Joined:
    Feb 4, 2017
    Messages:
    102
    Likes Received:
    1
    Hey there! I am unsure of the skript that I should be using to send messages to players that are in a different world, the world name is "Games" can someone please help me, thanks :emoji_slight_smile: (I do not have any other skript plugins but I am open to download any of them that I need for this)
     
  2. ShaneBee

    Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,168
    Likes Received:
    172
    If you want to send a message to all players in a single world, you can use:
    Code (Skript):
    1. broadcast "Whoa, this is a broadcast." to "Games"
    2. # Send a message to all player's in the world "Games"
    3.  
    4. loop all players:
    5.     if "%loop-player's world%" is "Games":
    6.         send "Whoa, this is a message." to loop-player
    7. # Send a message to each individual player in the world "Games"
    Both of those methods work. However, I don't know about the current state of the world expression for the broadcast event, which is why I provided the second option.
     
    • Like Like x 1
  3. ShaneBee

    Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,168
    Likes Received:
    172
    Please search on the docs before ask questions like this:
    http://skunity.com/effects?filter=Skript#Broadcast
    http://skunity.com/effects?filter=Skript#Message
    http://skunity.com/expressions?filter=Skript#Entities

    Examples of what you're trying to do:
    Code (Skript):
    1.  
    2. broadcast "hi" in world("world")
    3.  
    4. send "hi" to all players in world("world")
    5.  
    @mathhulk the message effect support multiple players, you don't need to do a loop for it, but in the case that you want to do the loop, I would recommend to use the where filter of skQ:
    Code (Skript):
    1.  
    2. loop players where [player input is in world("world")]:
    3.       send "hi" to loop-player
    4.  
     
    #3 ShaneBee, Feb 4, 2017
    Last edited by a moderator: Feb 4, 2017
    • Winner Winner x 1
Thread Status:
Not open for further replies.
Loading...