特定のtagがついている人だけチャットを変更したい

https://discord.com/channels/545926404785569793/1159872834517094551 理想はこれの運営とかの欄が返れてtagがついていなければ変えないようにしたい if player has tagをつけるとエラーでできません
Solution:
できました! ありがとうございます...
Jump to solution
27 Replies
Tsukineko(月雲)
https://discord.com/channels/545926404785569793/1150301110335180871/1150303875228766269 これ付与対象【entity】だったから 多分playerも出来ると思う set metadata "permission" of player to "admin"
syumaidayo
syumaidayo9mo ago
on chat:
if player has tag "tyuunibyou":
set the chat format to "[&6中二病&f] %player%: %message%"
if player has permission "op":
set the chat format to "[&d生活鯖運営&f] %player%: %message%"
else:
set the chat format to "[&2鯖民&f] %player%: %message%"
on chat:
if player has tag "tyuunibyou":
set the chat format to "[&6中二病&f] %player%: %message%"
if player has permission "op":
set the chat format to "[&d生活鯖運営&f] %player%: %message%"
else:
set the chat format to "[&2鯖民&f] %player%: %message%"
現在これの2行目 if player has tag "tyuunibyou":でエラーをはいているのですがどこに付け足せばいいでしょうか
Tsukineko(月雲)
tyuunibyou をいつつけるかに寄ります 要するにtagつけの段階からskriptで制御する発想なので…
syumaidayo
syumaidayo9mo ago
GUIからできる感じですかね 自分の表示名をこれにするって感じです 要するにららあーすの上の句だけと思ってもらえれば
ねんねこ
ねんねこ9mo ago
metadataは再起動したら消えてしまうはず 再起動して消えるのがいやなら変数を使いましょう {pdata::%player%::tag}
ねんねこ
ねんねこ9mo ago
Qiita
Minecraft Skript 基礎編 Part.1 - Qiita
#変数について・・・入門編で書こうか迷ったけど、変数は少し厄介だから、基礎編に書こうと思う。変数というのは簡単に言えば、あらゆるものを格納する箱だと思ってください。主な種類は 変数 一時変数 …
yukkina
yukkina9mo ago
scoreboard tagって意味かと思ったら違ったか
syumaidayo
syumaidayo9mo ago
もしプレイヤーにtyuunibyouというtagがついてたらって if player has tagでいいですよね
Tsukineko(月雲)
あー…永久保存で 加えて可変的なのね… だとmetadataは不適合だな っていうとしたら もう説明されてた
ねんねこ
ねんねこ9mo ago
https://tryitands.ee/ (自分で試して)
syumaidayo
syumaidayo9mo ago
tagでは難しかったので変えます もし{nicklv.%player%}が1だったらって指定できますかね? if {nick.%player%} = 1こんな感じですかね?
yukkina
yukkina9mo ago
is
Tsukineko(月雲)
https://tryitands.ee/ (自分で試して)
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
=もいけます
yukkina
yukkina9mo ago
はえーーーーーー せめて==じゃないのか
Tsukineko(月雲)
skriptの悪いところ(
syumaidayo
syumaidayo9mo ago
on join:
if name of player is "syumai2367":
set {permissionlv.%player%} to 3
if name of player is ".silverfish1218":
set {permissionlv.%player%} to 1
if name of player is ".koro20190414":
set {permissionlv.%player%} to 1
if name of player is "Tacken":
set {permissionlv.%player%} to 1
on join:
if name of player is "syumai2367":
set {permissionlv.%player%} to 3
if name of player is ".silverfish1218":
set {permissionlv.%player%} to 1
if name of player is ".koro20190414":
set {permissionlv.%player%} to 1
if name of player is "Tacken":
set {permissionlv.%player%} to 1
これだと 17:54:20 INFO]: 56行目: (onchat_1.sk) [17:54:20 INFO]: indentation error: expected 8 spaces, but found 2 tabs [17:54:20 INFO]: 該当部分: set {permissionlv.%player%} to 1 こんな感じに出るんですが2回tab押すのであってますよね?
syumaidayo
syumaidayo9mo ago
on chat:
if {nicklv.%player%} = 1:
set the chat format to "[&2LEVEL1&f] %player%: %message%"
if {nicklv.%player%} = 2:
set the chat format to "[&5LEVEL2&f] %player%: %message%"
if {nicklv.%player%} = 3:
set the chat format to "[&4LEVEL3&f] %player%: %message%"
else:
set the chat format to "[&aLEVEL0&f] %player%: %message%
on chat:
if {nicklv.%player%} = 1:
set the chat format to "[&2LEVEL1&f] %player%: %message%"
if {nicklv.%player%} = 2:
set the chat format to "[&5LEVEL2&f] %player%: %message%"
if {nicklv.%player%} = 3:
set the chat format to "[&4LEVEL3&f] %player%: %message%"
else:
set the chat format to "[&aLEVEL0&f] %player%: %message%
これでスコアが1ならなどと定義しているのですが elseのほうになってしまいます。
No description
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
nicklvっていう変数の値はどうなっていますか
syumaidayo
syumaidayo9mo ago
command /status [<player>]:
trigger:
if arg is not set:
send "your status=========="
send "レベル:%{nicklv.%player%}%"
send "総チャット数:%{totalchat.%player%}%"
set {dif.%player%} to {chatlv.%player%} - {nick.%player%}+1
send "次のレベルまで:%{dif.%player%}%"
send "====================="
if arg is set:
send "%arg%'s status=========="
send "レベル:%{nicklv.%arg%}%"
send "総チャット数:%{totalchat.%arg%}%"
set {dif.%arg%} to {chatlv.%arg%} - {nick.%arg%}+1
send "次のレベルまで:%{dif.%arg%}%"
send "====================="
command /status [<player>]:
trigger:
if arg is not set:
send "your status=========="
send "レベル:%{nicklv.%player%}%"
send "総チャット数:%{totalchat.%player%}%"
set {dif.%player%} to {chatlv.%player%} - {nick.%player%}+1
send "次のレベルまで:%{dif.%player%}%"
send "====================="
if arg is set:
send "%arg%'s status=========="
send "レベル:%{nicklv.%arg%}%"
send "総チャット数:%{totalchat.%arg%}%"
set {dif.%arg%} to {chatlv.%arg%} - {nick.%arg%}+1
send "次のレベルまで:%{dif.%arg%}%"
send "====================="
こう書いているので2だと思います 詳しいことわからなくてすいません
Tsukineko(月雲)
broadcastしてみよう
syumaidayo
syumaidayo9mo ago
2ですね
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
ちなみにエラーは出てますか
syumaidayo
syumaidayo9mo ago
broadcastはエラーなし skriptリロード
[19:32:59 INFO]: 66行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 3
[19:32:59 INFO]:
[19:32:59 INFO]: 65行目: (onchat_1.sk)
[19:32:59 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[19:32:59 INFO]: 該当部分: if name of player is "syumai2367":
[19:32:59 INFO]:
[19:32:59 INFO]: 68行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 1
[19:32:59 INFO]:
[19:32:59 INFO]: 67行目: (onchat_1.sk)
[19:32:59 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[19:32:59 INFO]: 該当部分: if name of player is ".silverfish1218":
[19:32:59 INFO]:
[19:32:59 INFO]: 70行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 1
[19:32:59 INFO]:
[19:32:59 INFO]: 69行目: (onchat_1.sk)
[19:32:59 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[19:32:59 INFO]: 該当部分: if name of player is ".koro20190414":
[19:32:59 INFO]:
[19:32:59 INFO]: 72行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 1
[19:32:59 INFO]: 66行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 3
[19:32:59 INFO]:
[19:32:59 INFO]: 65行目: (onchat_1.sk)
[19:32:59 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[19:32:59 INFO]: 該当部分: if name of player is "syumai2367":
[19:32:59 INFO]:
[19:32:59 INFO]: 68行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 1
[19:32:59 INFO]:
[19:32:59 INFO]: 67行目: (onchat_1.sk)
[19:32:59 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[19:32:59 INFO]: 該当部分: if name of player is ".silverfish1218":
[19:32:59 INFO]:
[19:32:59 INFO]: 70行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 1
[19:32:59 INFO]:
[19:32:59 INFO]: 69行目: (onchat_1.sk)
[19:32:59 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[19:32:59 INFO]: 該当部分: if name of player is ".koro20190414":
[19:32:59 INFO]:
[19:32:59 INFO]: 72行目: (onchat_1.sk)
[19:32:59 INFO]: indentation error: expected 8 spaces, but found 2 tabs
[19:32:59 INFO]: 該当部分: set {permissionlv.%player%} to 1
こんな感じです ここがエラーはいてる感じですかね?
yukkina
yukkina9mo ago
スペースと タブか 混同してるねん VSCodeつかってれば右下から一括で変換できるよん
Solution
syumaidayo
syumaidayo9mo ago
できました! ありがとうございます
yukkina
yukkina9mo ago
質問「特定のtagがついている人だけ・・・」 回答「できました!ありがとうございます」 っていう風に検索した時に出てくるのか(困惑)
Want results from more Discord servers?
Add your server
More Posts
if {変数::%block%} <= 0が効かない> クリックしたときのイベント ```on right click: set {_loc} to event-block if y-coordinate of {_loc} is no【解決済み】chat eventが反応してない``` [00:18:43 INFO]: [Skript] Line 12: (menu.sk) [00:18:43 INFO]: Starting a variable's name witアイテム欄がいっぱいでskriptのgiveが動作しない時の対策この鯖で2回訪ねて以下の4種類のコマンドを作ったのですが、 ``` on break: event-block is deepslate_diamond_ore chance of 2while構文の想定外の動き(条件にあってなくてもとまらない)``` function spawnGunnerMob(loc: location) :: entity: spawn zombie at {_loc} set {_entity} 採掘時の確率scriptsのキル時確率版の作成以下のscriptsのキルした時版が作りたいです!! 『on break: event-block is diamond_ore chance of 20%: giveset lore of tool of player to "あああ" with ・・・この文で繋げていくとis not an nbt compoundとエラーが発生し、アイテムにloreを複数行つけられません。set the lineなどでラインを絞ってloreをsetしようとしたのでエンダーパールのようなクールダウンエフェクト?を特定のアイテムに付けたいServer 1.20.1 Skript 2.7.0OneBlockの用にランダムなブロックを置きたいがリセットコマンドの方だけうまくいく!?``` on break: set {_loc} to location(0.5,64.5,0.5,world "oneblock") if event-block's locatioskript Ver.2.7.0の「give」で与えるアイテムをエンチャント付与だけではなく名前と説明文も変えたいexecute console command "ゲーム内コマンド"で出来るとの情報を得たのでしてみたところ名前等の変更コマンドに対応してなく、giveコマンドを調べたのですが、エンチャント付与以外見銃のサンプルコードが欲しいこれまで矢の射撃速度を上げて疑似的な銃として使用していましたが、エフェクトを射線につけることができなくて他の方法で弾丸を射撃できるようにしたいです。どなたかサンプルコードをください Skript 2.