Gamebuster icon

Puddles.sk v0.5.1

Gamebuster | PRO | 08/03/14 12:53:16 AM UTC | 0 ⭐ | 1115 👁️ | Never ⏰ | []
text |

3.41 KB

|

None

|

0 👍

/

0 👎

#Version 0.5.1
#In order to download or use this software, you must agree to it's license: http://pastebin.com/raw.php?i=JGSLhFdU
 every 1 tick:
	loop players:
		if is raining in loop-player's world:
			set {_valid.%loop-player%} to true
			set {_loc} to location of loop-player
			set {_horizontalX} to a random integer between (-100 + loop-player's location's x-coordinate) and (100 + loop-player's location's x-coordinate)
			set {_horizontalZ} to a random integer between (-100 + loop-player's location's z-coordinate) and (100 + loop-player's location's z-coordinate)
			set {_vertical} to a random integer between (-20 + loop-player's location's y-coordinate) and (20 + loop-player's location's y-coordinate)
			set {_world} to loop-player's world
			set {_puddleLoc} to loop-player's location
			set the x-coordinate of {_puddleLoc} to {_horizontalX} - 0.5
			set the y-coordinate of {_puddleLoc} to {_vertical} - 0.5
			set the z-coordinate of {_puddleLoc} to {_horizontalZ}
			if block at {_puddleLoc} is air:
				if block below {_puddleLoc} is dirt, stone, grass, cobblestone, bedrock, sand, any wood, any log, gravel, or stone bricks:
					loop blocks above block at {_puddleLoc}:
						if loop-block is not air, leaves, water item, or flowing water:
							set {_valid.%loop-player%} to false
				else:
					set {_valid.%loop-player%} to false
			else:
				set {_valid.%loop-player%} to false
			if {_valid.%loop-player%} is true:
				set block at {_puddleLoc} to water
				set data value of block at {_puddleLoc} to 7
				if {puddle.debug} is on:
					message "Puddle added at %{_puddleLoc}%" to loop-player
				add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
 every 1 second:
	loop worlds:
		if is raining in loop-world:
			set {_chance} to 1%
		else:
			set {_chance} to 20%
		chance of {_chance}:
			set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
			if {_loc} is set:
				if block at {_loc} is water:
					if data value of block at {_loc} is 7:
						set block at {_loc} to air
						if {puddle.debug} is on:
							broadcast "Puddle removed at %{_loc}%"
					else if {puddle.debug} is on:
						broadcast "Puddle no longer exists at %{_loc}%"
				else if {puddle.debug} is on:
					broadcast "Puddle no longer exists at %{_loc}%"
				wait 1 tick
				remove all {_loc} from {puddleLocations.%loop-world%::*}
 command /puddles [<text="%command sender's world%">]:
	trigger:
		if player is an op:
			if argument 1 is "clear":
				loop worlds:
					loop {puddleLocations.%loop-world%::*}:
						set block at loop-value to air
						remove all loop-value from {puddleLocations.%loop-world%::*}
			if player is an op:
				loop {puddleLocations.%argument 1% parsed as world::*}:
					message "%loop-value%" to command sender
 on physics:
	if event-block is water:
		if data value of event-block is 7:
			set {_persist} to false
			set {_loc} to event-block's location
			subtract 0.5 from the z-coordinate of {_loc}
			loop {puddleLocations.%event-world%::*}:
				if "%loop-value%" = "%{_loc}%":
					cancel the event
					set {_persist} to true
			if {puddle.debug} is true:
				if {_persist} is true:
					broadcast "Puddle persisting at %event-location%"
 command /pdebug <boolean>:
	trigger:
		if command sender is an op:
			set {puddle.debug} to argument 1
 command /rain:
	trigger:
		if command sender is an op:
			set weather to rain

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎