くr
くr
PDCPlayerRealms developerS Community
Created by くr on 10/16/2023 in #help-forum
範囲攻撃ができなくなる
on damage:
attacker is in "pve"
if cooldown of attacker's tool of attacker is not 0:
cancel event
stop
if attacker is a player:
if uncolored victim's name is "ブタ":
set {_dmg} to {damage::%attacker%} + {muscle::%attacker's uuid%} / 10
set {_dmg} to {_dmg} / 2
set damage to {_dmg}
set cooldown of attacker's tool of attacker to {atkspeed::%attacker%}
on damage:
attacker is in "pve"
if cooldown of attacker's tool of attacker is not 0:
cancel event
stop
if attacker is a player:
if uncolored victim's name is "ブタ":
set {_dmg} to {damage::%attacker%} + {muscle::%attacker's uuid%} / 10
set {_dmg} to {_dmg} / 2
set damage to {_dmg}
set cooldown of attacker's tool of attacker to {atkspeed::%attacker%}
これを実行してみたところ範囲攻撃ができなくなってしまいます 範囲攻撃ぜんぶのダメージを変えるにはどうすればよいですか
10 replies
PDCPlayerRealms developerS Community
Created by くr on 10/8/2023 in #help-forum
if {変数::%block%} <= 0が効かない
クリックしたときのイベント
on right click:
set {_loc} to event-block
if y-coordinate of {_loc} is not 4.5:
stop
if cooldown of player's tool of player is not 0:
stop
if event-block is coarse dirt:
if {block.health::%event-block%} is not set:
SetBlockHealth(event-block,5,15)
if {block.health::%event-block%} is set:
DestroyProcess(event-block,player)
on right click:
set {_loc} to event-block
if y-coordinate of {_loc} is not 4.5:
stop
if cooldown of player's tool of player is not 0:
stop
if event-block is coarse dirt:
if {block.health::%event-block%} is not set:
SetBlockHealth(event-block,5,15)
if {block.health::%event-block%} is set:
DestroyProcess(event-block,player)
クリックしたときの処理
function SetBlockHealth(block: block,a: number, b: number):
set {_block.health} to random number between {_a} and {_b}
set {block.health::%{_block}%} to {_block.health}
set {max.block.health::%{_block}%} to {_block.health}
set {_loc} to location of {_block}
add 1.15 to y-coordinate of {_loc}
set {_string} to getBlockHolo({_block})
create holo object "%{_string}%" with id "%{_block}%" at {_loc}
function DestroyProcess(block: block,p: player):
set {_block.loc} to location of {_block}
set {_u} to uuid of {_p}
remove {Power::%{_u}%} from {block.health::%{_block}%}
set destroy stage with id "%{_block}%" of {_block} to getDestroyStage({_block})
set cooldown of {_p}'s tool of {_p} to 20
set {_string} to getBlockHolo({_block})
edit holo object "%{_block}%" to "%{_string}%"
play sound "block.gravel.break" with pitch 2 to {_p}
send "%{block.health::%{_block}%}%" to {_p}
if {block.health::%{_block}%} <= 0:
delete {block.health::%{_block}%}
delete holo object "%{_block}%"
break {_block}
execute console command "/particle cloud %x-coordinate of {_block.loc}% %y-coordinate of {_block.loc}% %z-coordinate of {_block.loc}% 0.2 0.2 0.2 0.05 4 normal @a"
function SetBlockHealth(block: block,a: number, b: number):
set {_block.health} to random number between {_a} and {_b}
set {block.health::%{_block}%} to {_block.health}
set {max.block.health::%{_block}%} to {_block.health}
set {_loc} to location of {_block}
add 1.15 to y-coordinate of {_loc}
set {_string} to getBlockHolo({_block})
create holo object "%{_string}%" with id "%{_block}%" at {_loc}
function DestroyProcess(block: block,p: player):
set {_block.loc} to location of {_block}
set {_u} to uuid of {_p}
remove {Power::%{_u}%} from {block.health::%{_block}%}
set destroy stage with id "%{_block}%" of {_block} to getDestroyStage({_block})
set cooldown of {_p}'s tool of {_p} to 20
set {_string} to getBlockHolo({_block})
edit holo object "%{_block}%" to "%{_string}%"
play sound "block.gravel.break" with pitch 2 to {_p}
send "%{block.health::%{_block}%}%" to {_p}
if {block.health::%{_block}%} <= 0:
delete {block.health::%{_block}%}
delete holo object "%{_block}%"
break {_block}
execute console command "/particle cloud %x-coordinate of {_block.loc}% %y-coordinate of {_block.loc}% %z-coordinate of {_block.loc}% 0.2 0.2 0.2 0.05 4 normal @a"
6 replies
PDCPlayerRealms developerS Community
Created by くr on 9/22/2023 in #help-forum
リスト変数にテキストを入れたい
command /setname [<text>]:
permission: op
permission message: &cあなたは運営ではありません
aliases: sn
trigger:
if arg is not set:
send "{@m} usage ➡ &d/setname <item_name>"
stop
if player's tool is air:
send "{@m} 名前を変えたいアイテムを手に持ってください"
stop
else:
set name of player's tool to "%colored arg%"
play sound "block.anvil.use" with volume 0.7 and pitch 2 to player
send "{@m} %colored arg% &fに名前を変更しました"
set {_name} to colored arg
add {_name} to {namehistory::%player's tool%::*}
command /setname [<text>]:
permission: op
permission message: &cあなたは運営ではありません
aliases: sn
trigger:
if arg is not set:
send "{@m} usage ➡ &d/setname <item_name>"
stop
if player's tool is air:
send "{@m} 名前を変えたいアイテムを手に持ってください"
stop
else:
set name of player's tool to "%colored arg%"
play sound "block.anvil.use" with volume 0.7 and pitch 2 to player
send "{@m} %colored arg% &fに名前を変更しました"
set {_name} to colored arg
add {_name} to {namehistory::%player's tool%::*}
20 replies
PDCPlayerRealms developerS Community
Created by くr on 9/14/2023 in #help-forum
UUIDから名前を取りたい
ランキングを作りたくて今までUUIDの変数を使っていたのでUUIDからプレイヤーの名前をとれますかね?
4 replies
PDCPlayerRealms developerS Community
Created by くr on 9/11/2023 in #help-forum
インベントリに入っているアイテムの説明にある数字が読み込めない
if name of current inventory contain "&7&l修復":
cancel event
if event-inventory is player's inventory:
cancel event
if event-item is pickaxe:
if slot 11 of player's current inventory is air:
set slot 11 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&6砥石":
if slot 12 of player's current inventory is air:
set slot 12 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&a修復する":
cancel event
set {_tool::1} to slot 11 of player's current inventory
set {_repair::1} to slot 12 of player's current inventory
set slot 15 of player's current inventory to {_tool::1}
set {_mine.repair_item::*} to uncolored line 1 of lore of {_repair::1} parsed as "Repair: %number%"
if parse error is not set:
set {_repair.amount::*} to {_mine.repair_item::1}
set {_mine.tool_health::*} to uncolored line 9 of lore of {_tool::1} parsed as "Durability %number% / %number%"
if parse error is not set:
set {_maxmum::*} to {_mine.tool_health::2}
set {_health::*} to {_mine.tool_health::1}
add {_repair.amount::*} to {_health::*}
if {_health::*} > {_maxmum::*}:
set {_health::*} to {_maxmum::*}
set line 9 of lore of slot 15 of player's current inventory to "&aDurability &f%{_health::*}% / %{_maxmum::*}%"
set slot 11 of player's current inventory to air
set slot 12 of player's current inventory to air
if name of current inventory contain "&7&l修復":
cancel event
if event-inventory is player's inventory:
cancel event
if event-item is pickaxe:
if slot 11 of player's current inventory is air:
set slot 11 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&6砥石":
if slot 12 of player's current inventory is air:
set slot 12 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&a修復する":
cancel event
set {_tool::1} to slot 11 of player's current inventory
set {_repair::1} to slot 12 of player's current inventory
set slot 15 of player's current inventory to {_tool::1}
set {_mine.repair_item::*} to uncolored line 1 of lore of {_repair::1} parsed as "Repair: %number%"
if parse error is not set:
set {_repair.amount::*} to {_mine.repair_item::1}
set {_mine.tool_health::*} to uncolored line 9 of lore of {_tool::1} parsed as "Durability %number% / %number%"
if parse error is not set:
set {_maxmum::*} to {_mine.tool_health::2}
set {_health::*} to {_mine.tool_health::1}
add {_repair.amount::*} to {_health::*}
if {_health::*} > {_maxmum::*}:
set {_health::*} to {_maxmum::*}
set line 9 of lore of slot 15 of player's current inventory to "&aDurability &f%{_health::*}% / %{_maxmum::*}%"
set slot 11 of player's current inventory to air
set slot 12 of player's current inventory to air
これで実行したんですけどツールのほうしか動かないです
11 replies