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.

On Chat Tab Complete

Discussion in 'Skript' started by Auswahluhr6004, Apr 2, 2017.

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

    Joined:
    Mar 1, 2017
    Messages:
    109
    Likes Received:
    1
    Hey,

    How can i make it so:

    When i wirte "b" then it searches after names with "b" in the name.

    But when i write "b" then comes a name with "a". Why???

    Pls. Can you help me
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Can you maybe show us your code?
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Yes, here:

    Code (Skript):
    1. on chat tab complete:
    2.     if {Modus.FreeBuild.%sender%} is true:
    3.         loop all players:
    4.             if {Modus.FreeBuild.%loop-player%} is true:
    5.                 if {chatnick1.%loop-player%} is not set:
    6.                     remove "%loop-player%" from completions
    7.                     add "%loop-player%" to completions
    8.                 else:
    9.                     add "%{ffanick.%loop-player%}%" to completions
    10.                     remove "%loop-player%" from completions
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    I have no idea what you are doing with your code.

    Maybe try this out:

    Code (Skript):
    1. on chat tab complete:
    2.     if "%last token%" is not "":
    3.         set {_l} to length of last token
    4.         loop all players:
    5.             set {_p} to {_l} first characters of "%loop-player%"
    6.             if "%{_p}%" is "%last token%":
    7.                 add "%loop-player%" to completions

    EDIT:

    Okay, i have read your code again. What i understand. you have set variables. if the player in world "Freebuild" or in Gamemode "Freebuild" or what ever. and if someone nicked.... so maybe try this out

    Code (Skript):
    1. on chat tab complete:
    2.     {Modus.FreeBuild.%sender%} is true
    3.     if "%last token%" is not "":
    4.         set {_l} to length of last token
    5.         loop all players:
    6.             {Modus.FreeBuild.%loop-player%} is true
    7.             if {chatnick1.%loop-player%} is true:
    8.                 set {_Player} to {chatnick1.%loop-player%}
    9.             else:
    10.                 set {_Player} to "%loop-player%"
    11.             set {_p} to {_l} first characters of "%{_Player}%"
    12.             if "%{_p}%" is "%last token%":
    13.                 add "%{_Player}%" to completions
     
    #4 ShaneBee, Apr 2, 2017
    Last edited by a moderator: Apr 2, 2017
Thread Status:
Not open for further replies.

Share This Page

Loading...