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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Spec Skript Fix/Request

Discussion in 'Requests' started by PotteryTNT, Dec 12, 2018.

  1. PotteryTNT

    PotteryTNT Member

    Joined:
    Jul 21, 2017
    Messages:
    41
    Likes Received:
    0
    Category: UHC

    What I want: Ok so, I have a skript that allows the person doing the command to put anyone and themselves in spectator mode. However, I would like to make it so if they do /spec, they are put into spec but cannot put anyone else into spec. Then I would like another permission being made if possible to put other people in spec (/spec <name>) then at the end, /unspec and /unspec <name> or /spec and /spec <name> again will take them out of spec.

    Ideas for commands: listed above

    Ideas for permissions: first permission spec.op, second permission spectate.op

    When I'd like it by: possibly this or next week

    The current skript i have: https://pastebin.com/Qi9Uus2w
     
  2. Best Answer:
    Post #2 by Runakai, Dec 17, 2018
  3. Runakai

    Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    I haven't tested it but the parser says everything should work fine. I don't know if I have made any dumb mistakes but i hope not haha
    Code (Skript):
    1.  
    2. command /spec [<player>]:
    3.     trigger:
    4.         if arg-1 is set:
    5.             if arg-1 is player:
    6.                 if arg-1's gamemode is not spectator:
    7.                     set arg-1's gamemode to spectator
    8.                     send "&cYou have set %arg-1%'s gamemode to spectator!"
    9.                     send "Your gamemode has been changed to spectator" to arg-1
    10.                 else:
    11.                     set arg-1's gamemode to survival
    12.                     send "&cYou have set %arg-1%'s gamemode to survival!"
    13.                     send "Your gamemode has been changed to survival" to arg-1
    14.             else:
    15.                 if player has permission "spec.other":
    16.                     if arg-1's gamemode is not spectator:
    17.                         set arg-1's gamemode to spectator
    18.                         send "&cYou have set %arg-1%'s gamemode to spectator!"
    19.                         send "Your gamemode has been changed to spectator" to arg-1
    20.                     else:
    21.                         set arg-1's gamemode to survival
    22.                         send "&cYou have set %arg-1%'s gamemode to survival!"
    23.                         send "Your gamemode has been changed to survival" to arg-1
    24.         else:
    25.             if player has permission "spec.other":
    26.                 send "Please insert your other someone others name"
    27.             else:
    28.                 if arg-1's gamemode is not spectator:
    29.                     set arg-1's gamemode to spectator
    30.                     send "&cYou have set %arg-1%'s gamemode to spectator!"
    31.                     send "Your gamemode has been changed to spectator" to arg-1
    32.                 else:
    33.                     set arg-1's gamemode to survival
    34.                     send "&cYou have set %arg-1%'s gamemode to survival!"
    35.                     send "Your gamemode has been changed to survival" to arg-1
    36.                    
    37.                
     

Share This Page

Loading...