Me and my sister (helping to test) keep falling under bedrock (no damage taken from void) upon swapping locations. Around Y=-100000 the server goes down and on restart we find ourselves on the right spots.
Anyone can spot an error?
Code:
command /deathswap <text> <player>:
permission: op
permission message: "<red>You're not OP. Ask OPs for rank or use server console to get it (or suck my pp)"
trigger:
if argument-text is "start":
set {DS.ON.BOOL} to true #This boolean variable determines whether or not is the Deathswap running
set {DS.1P} to sender #This variable determines the 1st player mainly for death event later on
set {DS.2P} to argument-player #This variable determines the 2nd mainly for death event later on
loop all players:
loop-player is {DS.1P}
send title "<purple> Deathswap has started" with subtitle "<red>Last standing wins" to player for 2 seconds with fadein 1 second and fade out 1 second
set {DS.TCD} to 300 #Variable to hold time countdown. 300/60 seconds= 5 minutes. This can be tweaked by adjusting the value
while {DS.TCD} > 0:
wait 1 second
subtract 1 from {DS.TCD}
if {DS.TCD} = 5:
send subtitle "<red>5 seconds left" #Notification about remaining time
if {DS.TCD} = 0:
set {DS.2P.LOC} to location of argument-player
teleport argument-player to sender
teleport sender to {DS.2P.LOC}
while {DS.ON.BOOL} is true:
set {DS.TCD} to 300 #The countdown will reset until someone of the two players dies
else if argument-text is "stop":
set {DS.ON.BOOL} to false
loop all players:
loop-player is {DS.1P}
send title "<orange> Deathswap was cancelled" with subtitle "<yellow>Noone won" to loop-player for 2 seconds with fadein 1 second and fade out 1 second
loop all players:
loop-player is {DS.2P}
send title "<orange> Deathswap was cancelled" with subtitle "<yellow>Noone won" to loop-player for 2 seconds with fadein 1 second and fade out 1 second
delete {DS.1P}
delete {DS.2P}
else:
send "<red>Can't understand argument text. Options are <orange>start <red>or <orange>stop"
on death:
if event-player is {DS.1P}:
send title "<lime>You Won!" to {DS.2P}
send title "<red>You Lost!" to {DS.1P}
set {DS.ON.BOOL} to false #So it will end, when one dies
else if event-player is {DS.2P}:
send title "<red>You Lost!" to {DS.2P}
send title "<lime>You Won!" to {DS.1P}
set {DS.ON.BOOL} to false
Anyone can spot an error?
Code:
command /deathswap <text> <player>:
permission: op
permission message: "<red>You're not OP. Ask OPs for rank or use server console to get it (or suck my pp)"
trigger:
if argument-text is "start":
set {DS.ON.BOOL} to true #This boolean variable determines whether or not is the Deathswap running
set {DS.1P} to sender #This variable determines the 1st player mainly for death event later on
set {DS.2P} to argument-player #This variable determines the 2nd mainly for death event later on
loop all players:
loop-player is {DS.1P}
send title "<purple> Deathswap has started" with subtitle "<red>Last standing wins" to player for 2 seconds with fadein 1 second and fade out 1 second
set {DS.TCD} to 300 #Variable to hold time countdown. 300/60 seconds= 5 minutes. This can be tweaked by adjusting the value
while {DS.TCD} > 0:
wait 1 second
subtract 1 from {DS.TCD}
if {DS.TCD} = 5:
send subtitle "<red>5 seconds left" #Notification about remaining time
if {DS.TCD} = 0:
set {DS.2P.LOC} to location of argument-player
teleport argument-player to sender
teleport sender to {DS.2P.LOC}
while {DS.ON.BOOL} is true:
set {DS.TCD} to 300 #The countdown will reset until someone of the two players dies
else if argument-text is "stop":
set {DS.ON.BOOL} to false
loop all players:
loop-player is {DS.1P}
send title "<orange> Deathswap was cancelled" with subtitle "<yellow>Noone won" to loop-player for 2 seconds with fadein 1 second and fade out 1 second
loop all players:
loop-player is {DS.2P}
send title "<orange> Deathswap was cancelled" with subtitle "<yellow>Noone won" to loop-player for 2 seconds with fadein 1 second and fade out 1 second
delete {DS.1P}
delete {DS.2P}
else:
send "<red>Can't understand argument text. Options are <orange>start <red>or <orange>stop"
on death:
if event-player is {DS.1P}:
send title "<lime>You Won!" to {DS.2P}
send title "<red>You Lost!" to {DS.1P}
set {DS.ON.BOOL} to false #So it will end, when one dies
else if event-player is {DS.2P}:
send title "<red>You Lost!" to {DS.2P}
send title "<lime>You Won!" to {DS.1P}
set {DS.ON.BOOL} to false