Solved Bulk Send Messages to Global List of players

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Sep 19, 2020
22
0
1
24
So I recently had an Idea to create Factions on my RPG server. Somehow when I store a player's UUID to a list like {bloodlust::*}, and then send the message to that variable, It ain't work :/. Any idea how to do this?

My Code:

Code:
on quit:
    remove player's uuid from {bloodlust::*}
    remove player's uuid from {vanguard::*}
    delete {team.%player%}

command /faction [<text>] [<text>]:
    trigger:
        if arg-1 is "join":
            if {team.%player%} is not set:
                if arg-2 is "bloodlust":
                    if {first.faction.%player%} is true:
                        set {team.%player%} to true
                        add player's uuid to {bloodlust::*}
                        set {first.faction.%player%} to false
                        set {cant.move.%player%} to false
                        send "&6Faction: &fJoined the &cBloodlusts &fteam!" to player
                    else:
                        send "Error: You're already in a faction!" to player
                if arg-2 is "vanguard":
                    if {first.faction.%player%} is true:
                        set {team.%player%} to true
                        add player's uuid to {vanguard::*}
                        set {first.faction.%player%} to false
                        set {cant.move.%player%} to false
                        send "&6Faction: &fJoined the &9Vanguard &fteam!" to player
                    else:
                        send "Error: You're already in a faction!" to player
        if arg-1 is "chat":
            if {first.faction.%player%} is false:
                if arg-2 is set:
                    if {bloodlust::*} contains player's uuid:
                        send "&6Faction: &f%player%: %arg-2%" to {bloodlust::*}
                        send "blody" to player
                    else if {vanguard::*} contains player's uuid:
                        send "&6Faction: &f%player%: %arg-2%" to {vanguard::*}
                        send "vany" to player
                    else:
                        send "&cError: You aren't in a faction"

command /factionblood:
    trigger:
        send "%{bloodlust::*}%" to player

command /factionvangu:
    trigger:
        send "%{vanguard::*}%" to player
 

Attachments

  • Factions.sk
    2 KB · Views: 191
you probably could just loop that variable to send it like
Code:
        if {bloodlust::*} contains player's uuid:
            loop {bloodlust::*}:
                send "&6Faction: &f%player%: %arg-2%" to loop-value
        else if {vanguard::*} contains player's uuid:
            loop {vanguard::*}:
                send "&6Faction: &f%player%: %arg-2%" to loop-value

but.. i would do it like this just saying i've edited your skript a little
Code:
on chat:
    if {TeamChat.%player%} is true:
        if {bloodlust::*} contains player's uuid:
            loop {bloodlust::*}:
                send "&6Faction: &f%player%: %message%" to loop-value
        else if {vanguard::*} contains player's uuid:
            loop {vanguard::*}:
                send "&6Faction: &f%player%: %message%" to loop-value




on quit:
    remove player's uuid from {bloodlust::*}
    remove player's uuid from {vanguard::*}
    delete {team.%player%}
    delete {TeamChat.%player%}
 
command /faction [<text>] [<text>]:
    trigger:
        if arg-1 is "join":
            if {team.%player%} is not set:
                if arg-2 is "bloodlust":
                    if {first.faction.%player%} is true:
                        set {team.%player%} to true
                        add player's uuid to {bloodlust::*}
                        set {first.faction.%player%} to false
                        set {cant.move.%player%} to false
                        send "&6Faction: &fJoined the &cBloodlusts &fteam!" to player
                    else:
                        send "Error: You're already in a faction!" to player
                if arg-2 is "vanguard":
                    if {first.faction.%player%} is true:
                        set {team.%player%} to true
                        add player's uuid to {vanguard::*}
                        set {first.faction.%player%} to false
                        set {cant.move.%player%} to false
                        send "&6Faction: &fJoined the &9Vanguard &fteam!" to player
                    else:
                        send "Error: You're already in a faction!" to player
        if arg-1 is "chat":
            if {first.faction.%player%} is false:
                if arg-2 is set:
                    if {bloodlust::*} contains player's uuid:
                        if {TeamChat.%player%} is true:
                            send "&6Faction: &fChat Mode &4Disabled" to player
                            set {TeamChat.%player%} to false
                            stop

                        set {TeamChat.%player%} to true
                        send "&6Faction: &fChat Mode &2Enable" to player
                    else if {vanguard::*} contains player's uuid:
                        if {TeamChat.%player%} is true:
                            send "&6Faction: &fChat Mode &4Disabled" to player
                            set {TeamChat.%player%} to false
                            stop

                        set {TeamChat.%player%} to true
                        send "&6Faction: &fChat Mode &2Enable" to player
                    else:
                        send "&cError: You aren't in a faction"
 
command /factionblood:
    trigger:
        send "%{bloodlust::*}%" to player
 
command /factionvangu:
    trigger:
        send "%{vanguard::*}%" to player
just basicly put the chat feature in a chat event
 
I will try this out. Thank you so much.
[doublepost=1600537874,1600533361][/doublepost]I doesn't work. No errors. It doesn't send to any of the players on the list.
[doublepost=1600876308][/doublepost]I figured it out, so you need to send it to the {bloodlust::*} or loop-value PARSED as a PLAYER
[doublepost=1600892027][/doublepost]
I will try this out. Thank you so much.
[doublepost=1600537874,1600533361][/doublepost]I doesn't work. No errors. It doesn't send to any of the players on the list.
[doublepost=1600876308][/doublepost]I figured it out, so you need to send it to the {bloodlust::*} or loop-value PARSED as a PLAYER

Code:
loop {bloodlust::*}:
    send "Hello." to loop-value parsed as a player
 
Status
Not open for further replies.