Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import minqlx
- from time import sleep
- class slaphappy(minqlx.Plugin):
- def __init__(self):
- self.add_command("slaphappy", self.cmd_slaphappy, 2, usage="<id> <number of slaps> <delay between slaps> [damage]")
- def cmd_slaphappy(self, player, msg, channel):
- if len(msg) < 3:
- return minqlx.RET_USAGE
- try:
- slapee = self.player(int(msg[1]))
- if not (0 <= int(msg[1]) < 64) or not slapee:
- raise ValueError
- except ValueError:
- channel.reply("Invalid ID.")
- return minqlx.RET_STOP_ALL
- if not int(msg[4]):
- damage = 0
- else:
- damage = int(msg[4])
- counter = 0
- channel.reply("SLAPHAPPY ACTIVATED ON {}^7!".format(slapee.name))
- @minqlx.thread
- def f():
- while counter < int(msg[2]):
- slapee.health = (slapee.health - damage)
- slapee.velocity(z=50)
- time.sleep(float(msg[3]))
- counter += 1
- f()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement