skriptMC/deacoudre.sk

89 lines
4.2 KiB
Text

command deacoudre [<text>]: # lancement de la partie
executable by: players
description: Lance une partie de dé à coudre.
trigger:
if arg-1 is set:
if player is op:
if arg-1 is "spawn":
set {thimble.location} to location of player
send "&aLe dé à coudre téléportes désormais ici."
stop
else:
send option("errorMessage")
stop
if {thimble.location} is not set:
send "&4Tu n'as pas défini de point de téléportation : &r&l/deacoudre spawn"
stop
if {party.player.%uuid of player%} is set:
if {thimble} is true:
delete {thimble}
loop {party.list::*}:
send "&cPartie de dé à coudre terminée." to loop-value
teleport loop-value to {thimble.location}
set gamemode of loop-value to creative
execute player command "fill 103 57 -313 99 57 -305 water"
else:
set {thimble} to true
loop {party.list::*}:
send "&aDémarrage de la partie de dé à coudre !" to loop-value
teleport loop-value to {thimble.location}
set gamemode of loop-value to adventure
feed loop-value
heal loop-value
cure loop-value
else:
send "&4Tu n'es pas dans une partie."
every 0.5 second in "world": # pose du bloc et téléporatation
if {thimble} is not true:
stop
loop {party.list::*}:
set action bar of loop-value to "&dEn partie de &lDé à coudre&r&d."
if block at loop-value is water:
set {_xLocationBlock1} to difference between X-location of block at loop-value and 103.5
set {_xLocationBlock2} to difference between X-location of block at loop-value and 99.5
set {_zLocationBlock1} to difference between Z-location of block at loop-value and -312.5
set {_zLocationBlock2} to difference between Z-location of block at loop-value and -304.5
set {_yLocationBlock} to difference between Y-location of block at loop-value and 57.5
if {_xLocationBlock1} and {_xLocationBlock2} and {_zLocationBlock1} and {_zLocationBlock2} <= 0:
continue
if {_xLocationBlock1} and {_xLocationBlock2} >= 4:
continue
if {_yLocationBlock} != 0:
continue
if {_zLocationBlock1} and {_zLocationBlock2} >= 8:
continue
set {_niceJump} to true
set {_blockX} to X-location of block at loop-value
set {_blockY} to Y-location of block at loop-value
set {_blockZ} to Z-location of block at loop-value
if block at location ({_blockX} - 1), {_blockY}, {_blockZ} in world "world" is water:
set {_niceJump} to false
if block at location ({_blockX} + 1), {_blockY}, {_blockZ} in world "world" is water:
set {_niceJump} to false
if block at location {_blockX}, {_blockY}, ({_blockZ} - 1) in world "world" is water:
set {_niceJump} to false
if block at location {_blockX}, {_blockY}, ({_blockZ} + 1) in world "world" is water:
set {_niceJump} to false
if {_niceJump} is true:
set block at loop-value to gold block
set {_player} to loop-value
loop {party.list::*}:
if gamemode of {_player} is adventure:
send "%{_player}% a fait un beau jump !" to loop-value-2
else:
if gamemode of {_player} is adventure:
set block at loop-value to wool
teleport loop-value to {thimble.location}
feed loop-value
heal loop-value
on death:
if {thimble} is true:
if {party.player.%uuid of player%} is set:
cancel event
set gamemode of player to spectator
loop {party.list::*}:
send "&c%player%&b a été éliminé !" to loop-value