View difference between Paste ID: MFvWT1zM and rCWmspGL
SHOW: | | - or go back to the newest paste.
1
options:
2
	P: &8[&aElectrified&8]&e
3
4
command /electrified [<text>]:
5
	permission: skript.op
6
	trigger:
7
		if arg 1 is "on", "enable", or "give":
8
			loop all players:
9
				set {elec} to true
10
				apply speed 1 to the loop-player for 999 days
11
				apply haste 1 to the loop-player for 999 days
12
				give loop-player 1 redstone named "Battery"
13
				set {HasBattery::%loop-player%} to true
14
				set {CanUseBattery::%loop-player%} to true
15
				broadcast "{@P} Batteries given out and effects applied!"
16
				stop
17
		if arg 1 is "off", "disable", or "stop":
18
			set {elec} to false
19
			broadcast "{@P} Electrified ended!"
20
		if arg 1 is "reset":
21
			delete {HasBattery::*}
22
			delete {CanUseBattery::*}
23
			delete {elec}
24
			broadcast "{@P} All variables &breset!"
25
			stop
26
			
27
on login:
28
	if {elec} is true:
29
		if {HasBattery::%player%} is false:
30
			give player 1 redstone named "Battery"
31
			set {HasBattery::%player%} to true
32
			message "{@P} Battery given!" to the player
33
			
34
on right click:
35
	player's tool is redstone named "Battery":
36
		if {CanUseBattery::%player%} is false:
37
			message "{@P} You cannot use your battery, your 3 minutes hasn't gone up!"
38
		else:
39
			remove speed from the player
40
			remove haste from the player 
41
			apply haste 3 to the player for 17 seconds
42
			apply speed 2 to the player for 17 seconds
43
			broadcast "{@P} %player% is &bELECTRIFIED!"
44
			set {CanUseBattery::%player%} to false
45
			wait 18 seconds
46
			remove haste from the player
47
			remove speed from the player
48
			apply haste 1 to the player for 999 days 
49
			apply speed 1 to the player for 999 days
50
			wait 3 minutes
51
			set {CanUseBattery::%player%} to true
52
			message "{@P} You can use your battery again!"
53
			
54
on walk on water:
55
	block below the player is water
56
	block at the player is water
57
	if {elec} is true:
58
		set {_h} to health of player
59
		set {_d} to .20
60
		set player's health to ({_h} - {_d})