Solved How to make players transparent

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

Uzumaki

Well-Known Member
Feb 20, 2017
310
10
18
33
Is there are a possibility to make players transparent

2018_05_31_21_41_24.png
 
code_language.skript:
import:

  org.bukkit.Bukkit


effect make %players% [(1¦stop being)] transparent [for %-players%]:
  trigger:

    set {_viewers::*} to expressions-2 if raw expressions-2 exists, else all players
    loop expressions-1:
      set {_scoreboard} to loop-value.getScoreboard() otherwise Bukkit.getScoreboardManager().getNewScoreboard()
      set {_team} to {_scoreboard}.getTeam("transparent") otherwise {_scoreboard}.registerNewTeam("transpatent")

      {_team}.setCanSeeFriendlyVisibles(false if parser mark is 1, else true)
      if parser mark is 1:
        remove invisibility from random player out of loop-value
      else:
        apply invisibility without any particles to loop-value for 99 days

      loop expressions-2:
        if parser mark is 1:
          {_team}.removePlayer(loop-value-2)
        else:
          {_team}.addPlayer(loop-value-2)
    
      if {_team}.size() is 0:
        {_team}.unregister()

      loop-value.setScoreboard({_scoreboard})
Not sure if it works (made it on mobile) but it is worth a try. Needs skript-mirror 0.15.0 and Skript dev36
 
Last edited:
code_language.skript:
[02:59:59 ERROR]: Can't understand this condition/effect: {_team}.setCanSeeFriendlyVisibles(true if parser mark is 1, else false) (test.sk, line 20: {_team}.setCanSeeFriendlyVisibles(true if parser mark is 1, else false)')
[02:59:59 ERROR]: loop-value can't have anything removed from it (test.sk, line 22: remove invisibility from loop-value')
[02:59:59 ERROR]: There's no loop that matches 'loop-value for 99 days with no particles' (test.sk, line 24: apply invisibility to loop-value for 99 days with no particles')
[02:59:59 ERROR]: Can't understand this condition/effect: {_team}.removePlayer(loop-value-2) (test.sk, line 28: {_team}.removePlayer(loop-value-2)')
[02:59:59 ERROR]: Can't understand this condition/effect: {_team}.addPlayer(loop-value-2) (test.sk, line 30: {_team}.addPlayer(loop-value-2)')
[02:59:59 ERROR]: Can't understand this condition/effect: {_team}.unregister() (test.sk, line 33: {_team}.unregister()')
[02:59:59 ERROR]: Can't understand this condition/effect: loop-value.setScoreboard({_scoreboard}) (test.sk, line 35: loop-value.setScoreboard({_scoreboard})')
 
I told what it specifically needs on my post.
ups, sorry I had outdated skript-mirror on the test server, anyway

code_language.skript:
[03:34:13 ERROR]: [Skript] loop-value can't have anything removed from it (test.sk, line 22: remove invisibility from loop-value')
[03:34:13 ERROR]: [Skript] There's no loop that matches 'loop-value for 99 days with no particles' (test.sk, line 24: apply invisibility to loop-value for 99 days with no particles')
 
ups, sorry I had outdated skript-mirror on the test server, anyway

code_language.skript:
[03:34:13 ERROR]: [Skript] loop-value can't have anything removed from it (test.sk, line 22: remove invisibility from loop-value')
[03:34:13 ERROR]: [Skript] There's no loop that matches 'loop-value for 99 days with no particles' (test.sk, line 24: apply invisibility to loop-value for 99 days with no particles')
Updated the above code.
 
Just to confirm it, did it work properly? I'm going to move it to my snippets if so. Also, please mark the post as best answer if it did.

code_language.skript:
command /1:
    trigger:
        loop all players:
            make loop-player transparent for player

using that from above you can only see yourself transparent other players are invisible

and when players are already transparent(or they should be)

code_language.skript:
[12:14:10 WARN]: [Skript] method CraftScoreboard#registerNewTeam called with (transpatent (String)) threw a IllegalArgumentException: Team name 'transpatent' is already in use
 
@Uzumaki
code_language.skript:
effect make %players% [(1¦stop being)] transparent [for %-players%]:
    trigger:
        set {_viewers::*} to expressions-2 if raw expressions-2 exists, else all players
        loop {_viewers::*}:
            set {_scoreboard} to loop-value.getScoreboard() otherwise Bukkit.getScoreboardManager().getNewScoreboard()
            set {_team} to {_scoreboard}.getTeam("transparent") otherwise {_scoreboard}.registerNewTeam("transparent")
            if parser mark is 1:
                {_team}.setCanSeeFriendlyInvisibles(false)
            else:
                {_team}.setCanSeeFriendlyInvisibles(true)
            if parser mark is 1:
                remove invisibility from random player out of loop-value
            else:
                apply invisibility without any particles to loop-value for 99 days
 
            loop expressions-1:
                if parser mark is 1:
                    {_team}.removePlayer(loop-value-2)
                else:
                    {_team}.addPlayer(loop-value-2)
    
            if {_team}.size() is 0:
                {_team}.unregister()
 
            loop-value.setScoreboard({_scoreboard})

Fixed
 
  • Like
Reactions: Uzumaki
@Uzumaki
code_language.skript:
effect make %players% [(1¦stop being)] transparent [for %-players%]:
    trigger:
        set {_viewers::*} to expressions-2 if raw expressions-2 exists, else all players
        loop {_viewers::*}:
            set {_scoreboard} to loop-value.getScoreboard() otherwise Bukkit.getScoreboardManager().getNewScoreboard()
            set {_team} to {_scoreboard}.getTeam("transparent") otherwise {_scoreboard}.registerNewTeam("transparent")
            if parser mark is 1:
                {_team}.setCanSeeFriendlyInvisibles(false)
            else:
                {_team}.setCanSeeFriendlyInvisibles(true)
            if parser mark is 1:
                remove invisibility from random player out of loop-value
            else:
                apply invisibility without any particles to loop-value for 99 days
 
            loop expressions-1:
                if parser mark is 1:
                    {_team}.removePlayer(loop-value-2)
                else:
                    {_team}.addPlayer(loop-value-2)
   
            if {_team}.size() is 0:
                {_team}.unregister()
 
            loop-value.setScoreboard({_scoreboard})

Fixed
I've fixed it already just that I forgot to say it here
 
  • Like
Reactions: Uzumaki
Status
Not open for further replies.