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

https://discord.com/channels/545926404785569793/1159872834517094551 理想はこれの運営とかの欄が返れてtagがついていなければ変えないようにしたい if player has tagをつけるとエラーでできません
Solution:
できました! ありがとうございます...
Jump to solution
27 Replies
月猫ch
月猫ch15mo ago
https://discord.com/channels/545926404785569793/1150301110335180871/1150303875228766269 これ付与対象【entity】だったから 多分playerも出来ると思う set metadata "permission" of player to "admin"
syumaidaaa
syumaidaaaOP15mo 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":でエラーをはいているのですがどこに付け足せばいいでしょうか
月猫ch
月猫ch15mo ago
tyuunibyou をいつつけるかに寄ります 要するにtagつけの段階からskriptで制御する発想なので…
syumaidaaa
syumaidaaaOP15mo ago
GUIからできる感じですかね 自分の表示名をこれにするって感じです 要するにららあーすの上の句だけと思ってもらえれば
nennneko5787
nennneko578715mo ago
metadataは再起動したら消えてしまうはず 再起動して消えるのがいやなら変数を使いましょう {pdata::%player%::tag}
nennneko5787
nennneko578715mo ago
Qiita
Minecraft Skript 基礎編 Part.1 - Qiita
#変数について・・・入門編で書こうか迷ったけど、変数は少し厄介だから、基礎編に書こうと思う。変数というのは簡単に言えば、あらゆるものを格納する箱だと思ってください。主な種類は 変数 一時変数 …
yukkina
yukkina15mo ago
scoreboard tagって意味かと思ったら違ったか
syumaidaaa
syumaidaaaOP15mo ago
もしプレイヤーにtyuunibyouというtagがついてたらって if player has tagでいいですよね
月猫ch
月猫ch15mo ago
あー…永久保存で 加えて可変的なのね… だとmetadataは不適合だな っていうとしたら もう説明されてた
nennneko5787
nennneko578715mo ago
https://tryitands.ee/ (自分で試して)
syumaidaaa
syumaidaaaOP15mo ago
tagでは難しかったので変えます もし{nicklv.%player%}が1だったらって指定できますかね? if {nick.%player%} = 1こんな感じですかね?
yukkina
yukkina15mo ago
is
月猫ch
月猫ch15mo ago
https://tryitands.ee/ (自分で試して)
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
=もいけます
yukkina
yukkina15mo ago
はえーーーーーー せめて==じゃないのか
月猫ch
月猫ch15mo ago
skriptの悪いところ(
syumaidaaa
syumaidaaaOP15mo 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押すのであってますよね?
syumaidaaa
syumaidaaaOP15mo 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っていう変数の値はどうなっていますか
syumaidaaa
syumaidaaaOP15mo 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だと思います 詳しいことわからなくてすいません
月猫ch
月猫ch15mo ago
broadcastしてみよう
syumaidaaa
syumaidaaaOP15mo ago
2ですね
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
ちなみにエラーは出てますか
syumaidaaa
syumaidaaaOP15mo 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
yukkina15mo ago
スペースと タブか 混同してるねん VSCodeつかってれば右下から一括で変換できるよん
Solution
syumaidaaa
syumaidaaa15mo ago
できました! ありがとうございます
yukkina
yukkina15mo ago
質問「特定のtagがついている人だけ・・・」 回答「できました!ありがとうございます」 っていう風に検索した時に出てくるのか(困惑)
Want results from more Discord servers?
Add your server