List Variables -- Not working

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

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
46
Hey guys, i did some testing, and i came up with this:
code_language.skript:
on rightclick on sign:
    line 2 of the clicked block is "test":
        line 3 of the clicked block is "1":
            add player to {team::blue::*} #blue
            execute console command "warp test1 %player%"
        
on rightclick on sign:
    line 2 of the clicked block is "test":
        line 3 of the clicked block is "2":
            add player to {team::red::*} #red
            execute console command "warp test2 %player%"
            
            
command /tleave:
    trigger:
        if player is in {team::red::*}:
            message "&4Red"
            remove player from {team::red::*}
        
        else if player is in {team::blue::*}:
            message "&1Blue"
            remove player from {team::blue::*}
        
        else:
            message "&cYou are not in a team!"

It doesnt give me errors or something, but if i do /tleave, it says that im not in a team, but i joined via the sign method.

Can someone make this work?
 
do

code_language.skript:
if  "%player%" contains "%{team::red::*}%":


#or use the functions list.


Now if i join red, it works, but if i join blue then it is saying that im not in a team

code_language.skript:
on rightclick on sign:
    line 2 of the clicked block is "test":
        line 3 of the clicked block is "1":
            add player to {team::blue::*} #blue
            execute console command "warp test1 %player%"
      
on rightclick on sign:
    line 2 of the clicked block is "test":
        line 3 of the clicked block is "2":
            add player to {team::red::*} #red
            execute console command "warp test2 %player%"
          
          
command /tleave:
    trigger:
        if "%player%" contains "%{team::red::*}%":
            message "&4Red"
            remove player from {team::red::*}
      
        else if "%player%" contains "%{team::blue::*}%":
            message "&1Blue"
            remove player from {team::blue::*}
      
        else:
            message "&cYou are not in a team!"
!"
 
Hey guys, i did some testing, and i came up with this:
code_language.skript:
on rightclick on sign:
    line 2 of the clicked block is "test":
        line 3 of the clicked block is "1":
            add player to {team::blue::*} #blue
            execute console command "warp test1 %player%"
       
on rightclick on sign:
    line 2 of the clicked block is "test":
        line 3 of the clicked block is "2":
            add player to {team::red::*} #red
            execute console command "warp test2 %player%"
           
           
command /tleave:
    trigger:
        if player is in {team::red::*}:
            message "&4Red"
            remove player from {team::red::*}
       
        else if player is in {team::blue::*}:
            message "&1Blue"
            remove player from {team::blue::*}
       
        else:
            message "&cYou are not in a team!"

It doesnt give me errors or something, but if i do /tleave, it says that im not in a team, but i joined via the sign method.

Can someone make this work?
The issue is contains on lists is unreliable. Use this:
code_language.skript:
function contains(l: objects, v: object) :: boolean:
  loop {_l::*}:
    if loop-value is {_v}:
      return true
  return false
 
The issue is contains on lists is unreliable. Use this:
code_language.skript:
function contains(l: objects, v: object) :: boolean:
  loop {_l::*}:
    if loop-value is {_v}:
      return true
  return false

Im kinda new to Skript, so i dont really understand they way you wrote it now, can you make an example of it using my code?
 
I dont really follow that tutorial, as i said before, im pretty new at Skript coding
use Pikachu Function and then this way:

code_language.skript:
if contains({Team::Red::*}, player) is true:
    send "&2Red"
else if contains({Team::Blue::*}, player) is true:
    send "&bBlue"
else:
    send "Youre not in a team."

#Maybe you need add quotes in function ("%{Team::red::*}%", %player%)
 
Status
Not open for further replies.