Skript Version: Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.12.2
---
I'm trying to create a command that when used hides a moderator from other players by using /spec, /vanish, and /dynmap hide, however I have a gui that opens using the command as well that mods will likely be using multiple times before they wish to become visible again, so to avoid them cycling on and off of /vanish and /dynmap each time they use the command, I want to set it so that after the first time they use it it won't repeat those commands any subsequent times, and I figured variables would be the best way to do so:
the spec gamemode line is working fine I'm assuming because I didn't have to set any variables for that, but /vanish and /dynmap hide still activates on every use of the command. I'm guessing I'm not using the variables correctly, but I don't see any errors on the console so I'm not sure what I'm doing wrong
Skript Author: Bensku
Minecraft Version: 1.12.2
---
I'm trying to create a command that when used hides a moderator from other players by using /spec, /vanish, and /dynmap hide, however I have a gui that opens using the command as well that mods will likely be using multiple times before they wish to become visible again, so to avoid them cycling on and off of /vanish and /dynmap each time they use the command, I want to set it so that after the first time they use it it won't repeat those commands any subsequent times, and I figured variables would be the best way to do so:
code_language.skript:
trigger:
if arg-1 is "on":
if gamemode of player is not spectator:
execute player command "/spec"
if {_vanish.%player%} is not set:
execute player command "/vanish"
set {_vanish.%player%} to true
if {_dynmap.%player%} is not set:
execute player command "/dynmap hide"
set {_dynmap.%player%} to true
if arg-1 is "off":
if gamemode of player is spectator:
execute player command "/spec"
if {_vanish.%player%} is 1:
execute player command "/vanish"
delete {_vanish.%player%}
if {_dynmap.%player%} is 1:
execute player command "/dynmap show"
delete {_dynmap.%player%}
the spec gamemode line is working fine I'm assuming because I didn't have to set any variables for that, but /vanish and /dynmap hide still activates on every use of the command. I'm guessing I'm not using the variables correctly, but I don't see any errors on the console so I'm not sure what I'm doing wrong