I'm currently trying to create a generator that when placed, will start generating a value and whenever a player right clicks it, they will be given 10 * the amount that has been generated. The gen will run every 5 seconds. I can't find out how to allow multiple gens placed at once and for it to stop running once broken.
Full Code:
on place:
if event-block is red stained glass:
set {go} to true
every 5 seconds:
if {go} is true:
add 1 top {drop}
broadcast "Added 1 to get."
on right click:
if event-block is red stained glass:
if {drop} is equal to 0:
send "No iron in generator." to player
else:
give player {drop} of iron ingot named "Test"
send "Player recieved %{drop}% iron." to player
set {drop} to 0
Full Code:
on place:
if event-block is red stained glass:
set {go} to true
every 5 seconds:
if {go} is true:
add 1 top {drop}
broadcast "Added 1 to get."
on right click:
if event-block is red stained glass:
if {drop} is equal to 0:
send "No iron in generator." to player
else:
give player {drop} of iron ingot named "Test"
send "Player recieved %{drop}% iron." to player
set {drop} to 0