i am having this issue that when i try to target a player in a command. The command is as follows
The issue is when u use this it considers the player and the sender the same person and i tried using %args 1% instead of %player% but if i do that i cant teleport the player or change their gamemode.
Just a little extra background this is being used as a hardcore thing for a server for me and my friends, so when one of us dies we cant respawn until the others "revive" us using 10 diamonds or 64 iron
Skript version: 2.4.1
Minecraft Version: 1.15.2
Code:
command /revive <player>:
executable by: players
trigger:
if player's gamemode is spectator:
if sender is holding 10 diamonds:
remove 10 diamonds from sender
set gamemode of player to survival
teleport player to {deathspot.%player%}
send "&6&l%player% &ahas been revived." to sender
send "&6&l%sender% &ahas revived you for &b&l10 Diamonds." to player
broadcast "&6&l%player% &ahas been revived by &6&l%sender% &afor &b&l10 Diamonds."
stop
if sender is holding 64 iron ingots:
remove 64 iron ingots from sender
set gamemode of player to survival
teleport player to {deathspot.%player%}
send "&6&l%player% &ahas been revived." to sender
send "&6&l%sender% &ahas revived you for &7&l64 Iron." to player
broadcast "&6&l%player% &ahas been revived by &6&l%sender% &afor &b&l64 Iron."
stop
else:
send "&cYou must be holding either &b&l10 Diamonds &cor &7&l64 Iron &cto revive this player." to sender
stop
The issue is when u use this it considers the player and the sender the same person and i tried using %args 1% instead of %player% but if i do that i cant teleport the player or change their gamemode.
Just a little extra background this is being used as a hardcore thing for a server for me and my friends, so when one of us dies we cant respawn until the others "revive" us using 10 diamonds or 64 iron
Skript version: 2.4.1
Minecraft Version: 1.15.2