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.

Solved How to add Actionbar to script?

Discussion in 'Skript' started by Adrihun, May 14, 2017.

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

    Adrihun Member

    Joined:
    Feb 1, 2017
    Messages:
    368
    Likes Received:
    6
    Here is my Vanish script

    I want to make it so if you have vanished it says "vanished" in Actionbar.
    Right now, the text disappears after 1 second. Is it possible to change this so it will stay there until you do /vanish again?


    Code (Skript):
    1. command /vanish:
    2.     usage: no
    3.     permission: vanish.use
    4.     permission message: no
    5.     trigger:
    6.         if {sql_.mineplex.vanish.%player%} is true:
    7.             loop all players:
    8.                 loop-value doesn't have permission "vanish.see"
    9.                 add loop-value to {_vanishto::*}
    10.             reveal player from all players
    11.             set {sql_.mineplex.vanish.%player%} to false
    12.             send "not vanished"
    13.         else:
    14.             loop all players:
    15.                 loop-value doesn't have permission "vanish.see"
    16.                 add loop-value to {_vanishto::*}
    17.             hide player from {_vanishto::*}
    18.             set {sql_.mineplex.vanish.%player%} to true
    19.             send "you are vanishd"
    20.             send "staff or higher can still see yu"
    21.             show an action bar from "test" to player
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Change this
    Code (Skript):
    1. show an action bar from "test" to player
    For this.
    Code (Skript):
    1. while player is online:
    2.     set action bar of player to coloured "Test"
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Code (Skript):
    1. set {sql_.mineplex.vanish.%player%} to true
    2. send "you are vanishd"
    3. send "staff or higher can still see yu"
    4. while {sql_.mineplex.vanish.%player%} is true:
    5.     show an action bar from "test" to player
    6.     wait a second
     
    • Winner Winner x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    @HiiqhFive If player leaves, the actionbar will dissapear and they will still have vanish on. How do you fix this?
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Reveal him on quit.
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    @HiiqhFive Should i clear {sql_.mineplex.vanish.%player%} on disconnect aswell?
    (i dont want to store useless data in the database)

    Also is on quit the same as on disconnect?
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    "On quit" or "On disconect" is the same event.
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...