So this is basically a jail system, whenever the player gets in jail(dies), they have to pay 3 diamonds.
if they jailed again, they have to pay 6, and 9, and 12....(number of player sent to the jail * 3)
if the player has more diamond than he has to pay, the console will unjail the player, but
if player has {pay.player} diamond: <<I think this if statement cannot use variables. it works fine with the numbers, but not the variable. it skips to the else statement. {pay.diamond} supposed to be the amount of diamonds that the player has to pay to get unjailed.
I also tried if player's inventory contains {pay.player} of diamond:
here is the code:
on death of player:
player has permission "hack.worker":
if {salve.value} is true:
add 1 to {slave.player}
set {salve.value} to false
execute console command "jail %player% 1 100000000"
command /test:
trigger:
if {salve.value} is false:
set {pay.player} to {slave.player} * 3
if player has {pay.player} diamond:
remove {pay.player} of diamond from player
execute console command "unjail %player%"
set {salve.value} to true
send "&f&lyou were released" to player
else:
send "&f&lYou do not have enough diamonds! (Diamonds needed: &4%{pay.player}%&f&l" to player
else:
send "&f&lUnavailable for you" to player
if they jailed again, they have to pay 6, and 9, and 12....(number of player sent to the jail * 3)
if the player has more diamond than he has to pay, the console will unjail the player, but
if player has {pay.player} diamond: <<I think this if statement cannot use variables. it works fine with the numbers, but not the variable. it skips to the else statement. {pay.diamond} supposed to be the amount of diamonds that the player has to pay to get unjailed.
I also tried if player's inventory contains {pay.player} of diamond:
here is the code:
on death of player:
player has permission "hack.worker":
if {salve.value} is true:
add 1 to {slave.player}
set {salve.value} to false
execute console command "jail %player% 1 100000000"
command /test:
trigger:
if {salve.value} is false:
set {pay.player} to {slave.player} * 3
if player has {pay.player} diamond:
remove {pay.player} of diamond from player
execute console command "unjail %player%"
set {salve.value} to true
send "&f&lyou were released" to player
else:
send "&f&lYou do not have enough diamonds! (Diamonds needed: &4%{pay.player}%&f&l" to player
else:
send "&f&lUnavailable for you" to player