Dạ, thì chào mọi người như tiêu đề đoạn Skript mình có 1 vấn đề khá nghiêm trọng:
Nó bị 1 lỗi không xóa kho đồ người chơi khi respawn lại.Dù mình không sử dụng keepinventory nhma vẫn giữ, mong có bạn nào hỗ trợ mình việc này với ạ
Mẫu code ở dưới đây:
on death:
cancel event
cancel drops of items
if attacker is player:
send "&c&lCHẾT! &fbởi %attacker's prefix%%attacker%" to victim
send "&a&lHẠ GỤC! %victim's prefix%%victim%" to attacker
play sound "entity.villager.ambient" to attacker
else:
send "%{skypvp.message.nothing}%" to victim
set {redstone} to random integer between 12 and 64
drop {redstone} of redstone dust at event-location
chance of 1%:
set {emerald} to random integer between 1 and 3
drop {emerald} of emerald at event-location
teleport victim to {death_spawn}
set victim's gamemode to spectator
send title "&c&lBẠN ĐÃ CHẾT" to victim
wait 5 seconds
set victim's gamemode to survival
teleport victim to {spawn}
send title "&a&lHỒI SINH" to victim
play sound "entity.player.levelup" to victim
stop
Nó bị 1 lỗi không xóa kho đồ người chơi khi respawn lại.Dù mình không sử dụng keepinventory nhma vẫn giữ, mong có bạn nào hỗ trợ mình việc này với ạ
Mẫu code ở dưới đây:
on death:
cancel event
cancel drops of items
if attacker is player:
send "&c&lCHẾT! &fbởi %attacker's prefix%%attacker%" to victim
send "&a&lHẠ GỤC! %victim's prefix%%victim%" to attacker
play sound "entity.villager.ambient" to attacker
else:
send "%{skypvp.message.nothing}%" to victim
set {redstone} to random integer between 12 and 64
drop {redstone} of redstone dust at event-location
chance of 1%:
set {emerald} to random integer between 1 and 3
drop {emerald} of emerald at event-location
teleport victim to {death_spawn}
set victim's gamemode to spectator
send title "&c&lBẠN ĐÃ CHẾT" to victim
wait 5 seconds
set victim's gamemode to survival
teleport victim to {spawn}
send title "&a&lHỒI SINH" to victim
play sound "entity.player.levelup" to victim
stop
