When place a block, add time and coords in a variable, after a while delete everything.

  • 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.

Lummox

Member
Jan 29, 2017
28
0
1
42
Code:
on place of anomalia:
   add location of event-block to {anomalias.fuego::*}
   add now to {anomalias.tiempof::*}
  
every 1 seconds in world "world":
   if size of {anomalias.fuego::*} is bigger than 0:
       set {_maxf} to size of {anomalias.fuego::*}
       broadcast "SIZE OF MAXF: %{_maxf}%"
       set {_initf} to 1
       loop {_maxf} times:
           broadcast "DIFFERENCE: %{_initf}%: %difference between {anomalias.tiempof::%{_initf}%} and now%"
           if difference between {anomalias.tiempof::%{_initf}%} and now is more than 10 seconds:
               set {_l} to location at {anomalias.fuego::%{_initf}%}
               set block at {_l} to air
               delete {anomalias.fuego::%{_initf}%}
               delete {anomalias.tiempof::%{_initf}%}
           add 1 to {_initf}


I am trying to when I place a block, save its location in the variable {anomalias.fuego::*} and the time it was place the block in the variable {anomalias.tiempof::*}.

That works fine. (The part of the code that says on place of anomalia)

Then I want every X seconds, check that time variable, and if find that the time is greater than X seconds, delete the block, and also delete the block of those two variables (time and location). It works with the first block I place, if I put more ... delete the first, but not the second (or third, fourth, etc...)

5507451a54c3248fdf315e5ba92b848d.png
 
Status
Not open for further replies.