'm trying to make a skript, where if you kill someone an emerald drops with their name, and if you right click they get put into gamemode survival from gamemode adventure. I already have a code, but the right clicking part doesn't work
Code:
if attacker is a player:
set death message to "%attacker% kivegezte %victim%-t"
execute console command "gamemode adventure %victim%"
set {_i} to emerald named "%victim%"
add nbt compound of "{RepairCost:1000}" to nbt compound of {_i}
give attacker 1 of {_i}
set {_uuid} to victim's display name
on right click on stone:
if player's tool is an emerald:
if name of player's tool contains "{_i}":
execute console command "gamemode survival {_uuid}"
execute console command "clear %player% {_i}"```