Solved Checking Alts of A Player

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

iChinchillinq

Member
May 11, 2018
10
0
0
22
code_language.skript:
on first join:
    add "%player's ip% %player%" to {check::*}
    add player to {players::*}

command /alts [<offline player>]:
    permission: rank.admin
    permission message: &cInsufficient Permissions.
    trigger:
        if {players::*} does not contain player:
            add player to {players::*}
        if {check::*} contains "%arg-1's ip% %arg-1%":
            remove "%arg-1's ip% %arg-1%" from {check::*}
        loop {players::*}:
            if {check::*} contains "%arg-1's ip% %loop-value%":
                send "&c%loop-value% found."
            else:
                send "&cNone found."
        add "%arg-1's ip% %arg-1%" to {check::*}

This doesn't send any messages to the executor, and I have no clue why.
 
code_language.skript:
on first join:
    add "%player's ip% %player%" to {check::*}
    add player to {players::*}

command /alts [<offline player>]:
    permission: rank.admin
    permission message: &cInsufficient Permissions.
    trigger:
        if {players::*} does not contain player:
            add player to {players::*}
        if {check::*} contains "%arg-1's ip% %arg-1%":
            remove "%arg-1's ip% %arg-1%" from {check::*}
        loop {players::*}:
            if {check::*} contains "%arg-1's ip% %loop-value%":
                send "&c%loop-value% found."
            else:
                send "&cNone found."
        add "%arg-1's ip% %arg-1%" to {check::*}

This doesn't send any messages to the executor, and I have no clue why.
try
code_language.skript:
send "hi" to sender

EDIT: in newer versions CONTAINS is broken. In this case, use
code_language.skript:
if "%{check::*}%" contains "%arg-1's ip% %loop-value%":
 
Last edited:
Status
Not open for further replies.