Stop loop if taken damage

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Jonaz

Member
Nov 4, 2019
1
0
0
22
Hey bois and girls.

Im in the making of a drug lab skript. And i wanna make it so if u take damage the loop stops. This is what i have a this point in time.


on rightclick on dropper:
if "%region at event-block%" contains "Druglaborken":
cancel event
if {drugcooldown.%uuid of player%} is not set:
if {drugigang.%uuid of player%} is not set:
if player's inventory contains 1 wheat_item named "":
if player's inventory contains 1 flower_pot_item named "&7Poser &8&l( &a1 stk &8&l)":
if player has permission "druglab.donator":
set {drugigang.%uuid of player%} to 1
set {drugcooldown.%uuid of player%} to 1
set {drughash.%uuid of player%} to 1
remove 1 flower_pot named "&7Poser &8&l( &a1 stk &8&l)" from player's inventory
remove 1 wheat_item named "" from player's inventory
set {drugigang.%uuid of player%.freeze} to location of player

send "&5&lDrug Lab &7Påbegynder cutting af &8&lHash &8&l(&a2 Gram&8&l)" to player

if {online.%uuid of player%} is "Online":
set {_process.%uuid of player%} to 0
loop 100 times:
wait 1.2 ticks
add 1 to {_process.%uuid of player%}
if {_process.%uuid of player%} is between 0 and 9:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::&7&l:::::::::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 10 and 19:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::&7&l:::::::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 20 and 29:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::&7&l:::::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 30 and 39:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::&7&l:::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 40 and 49:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::&7&l:::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 50 and 59:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::&7&l:::::::: &8&l)" to player
if {_process.%uuid of player%} is between 60 and 69:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::::&7&l:::::: &8&l)" to player
if {_process.%uuid of player%} is between 70 and 79:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::::::&7&l:::: &8&l)" to player
if {_process.%uuid of player%} is between 80 and 89:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::::::::&7&l:: &8&l)" to player
if {_process.%uuid of player%} is between 90 and 100:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l:::::::::::::::::::: &8&l)" to player
wait 2 ticks
if {online.%uuid of player%} is "Online":
if {drugigang.%uuid of player%} is 1:
give player 1 wheat_item named "&8&lHash &8&l(&a2 Gram&8&l)"
send "" to player
send "&5&lDrug Lab &7Dit cut blev færdig gjordt uden fejl!" to player
send "" to player
wait 3 ticks
delete {drugigang.%uuid of player%}
wait 2 seconds
delete {drugcooldown.%uuid of player%}
stop

Does anyone know how to stop the loop if u take damage, or is it impossible?

Im sry the skript looks wierd, im new to this forum
[doublepost=1573114456,1572876169][/doublepost]bump
 
Hey bois and girls.

Im in the making of a drug lab skript. And i wanna make it so if u take damage the loop stops. This is what i have a this point in time.


on rightclick on dropper:
if "%region at event-block%" contains "Druglaborken":
cancel event
if {drugcooldown.%uuid of player%} is not set:
if {drugigang.%uuid of player%} is not set:
if player's inventory contains 1 wheat_item named "":
if player's inventory contains 1 flower_pot_item named "&7Poser &8&l( &a1 stk &8&l)":
if player has permission "druglab.donator":
set {drugigang.%uuid of player%} to 1
set {drugcooldown.%uuid of player%} to 1
set {drughash.%uuid of player%} to 1
remove 1 flower_pot named "&7Poser &8&l( &a1 stk &8&l)" from player's inventory
remove 1 wheat_item named "" from player's inventory
set {drugigang.%uuid of player%.freeze} to location of player

send "&5&lDrug Lab &7Påbegynder cutting af &8&lHash &8&l(&a2 Gram&8&l)" to player

if {online.%uuid of player%} is "Online":
set {_process.%uuid of player%} to 0
loop 100 times:
wait 1.2 ticks
add 1 to {_process.%uuid of player%}
if {_process.%uuid of player%} is between 0 and 9:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::&7&l:::::::::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 10 and 19:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::&7&l:::::::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 20 and 29:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::&7&l:::::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 30 and 39:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::&7&l:::::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 40 and 49:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::&7&l:::::::::: &8&l)" to player
if {_process.%uuid of player%} is between 50 and 59:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::&7&l:::::::: &8&l)" to player
if {_process.%uuid of player%} is between 60 and 69:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::::&7&l:::::: &8&l)" to player
if {_process.%uuid of player%} is between 70 and 79:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::::::&7&l:::: &8&l)" to player
if {_process.%uuid of player%} is between 80 and 89:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l::::::::::::::::::&7&l:: &8&l)" to player
if {_process.%uuid of player%} is between 90 and 100:
show an actionbar from "&5&lDrug Lab&7 Process &8&l(&a&l %{_process.%uuid of player%}%%% &8&l) &8&l( &a&l:::::::::::::::::::: &8&l)" to player
wait 2 ticks
if {online.%uuid of player%} is "Online":
if {drugigang.%uuid of player%} is 1:
give player 1 wheat_item named "&8&lHash &8&l(&a2 Gram&8&l)"
send "" to player
send "&5&lDrug Lab &7Dit cut blev færdig gjordt uden fejl!" to player
send "" to player
wait 3 ticks
delete {drugigang.%uuid of player%}
wait 2 seconds
delete {drugcooldown.%uuid of player%}
stop

Does anyone know how to stop the loop if u take damage, or is it impossible?

Im sry the skript looks wierd, im new to this forum
[doublepost=1573114456,1572876169][/doublepost]bump
Just replace 'stop' with 'cancel'
 
Status
Not open for further replies.