Solved Skript - Gamemode check

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

Simon942

Member
Sep 22, 2018
46
1
0
21
Hi peeps

I am noob to skript. But i wanna know is there a way i can check what gamemode the player is in?

Example is: If the player is in Creative or Survival, the players gamemode will be changed to Adventure gamemode.

Thanks in advance.
 
Hi there

I have tried what you have typed in there.
But the skript plugin says there is some errors in the skript. The plugin does not understands the line.
 
Yes i know :emoji_slight_smile:
I had used the docs forms :emoji_slight_smile:
But they doesn't works, is there some addons i need?
 
That worked!
Thank you so much, skript master :emoji_grinning:
The thing i forgot was the master line: On join: xD

Best regards Simon942
 
How can i add a permission to this skript? :emoji_slight_smile:

code_language.skript:
on join:
    if gamemode of player is creative or survival:
        set gamemode of player to adventure
 
How can i add a permission to this skript? :emoji_slight_smile:

code_language.skript:
on join:
    if gamemode of player is creative or survival:
        set gamemode of player to adventure
code_language.skript:
on join:
    if gamemode of player is creative or survival:
        if player has permission "some.permission":
            set gamemode of player to adventure
 
Ah crap!
Why am i getting this error?
kxjucw

http://prntscr.com/kxjucw
[doublepost=1537656760,1537656720][/doublepost]
code_language.skript:
on join:
    if gamemode of player is creative or survival:
            set gamemode of player to adventure
            
            
            
on join:
    if gamemode of player is survival or adventure:
        if player has permission "staff.gamemode":
            set gamemode of player to creative
 
Indentation errors.
What that means is skript only recognizes EITHER spaces or tabs as indentation. You cant mix the two within an event.
Depending on your text editor and how its set up for indentation, copy/pasting and then adding things in can cause your indentations to not match.
The best solution for fixing it, is delete the indents before the syntax, and re-indent them
 
Thank you for telling me that with the text editor (Notepad++) :emoji_slight_smile:
I didn't understood what you mean with the words: You can't mix the two within one event.

Is that what you mean?
code_language.skript:
on join:
    if gamemode of player is creative or survival:
            set gamemode of player to adventure
    if player has permission "staff.gamemode":
         if gamemode of player is survival or adventure:
            set gamemode of player to creative
[doublepost=1537657698,1537657461][/doublepost]I fixed it, by my self :emoji_slight_smile:
code_language.skript:
on join:
    if gamemode of player is survival or adventure:
        if player has permission "staff.gamemode":
            set gamemode of player to creative
on join:
      if gamemode of player is creative or survival:
            set gamemode of player to creative
 
Status
Not open for further replies.