Advertisement
Guest User

Hug Command

a guest
Mar 28th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Owner:/hug $player = >>>
  2. if(not(has_permission('*'))){
  3. # Length of cooldown in seconds.
  4. assign(@cooldown,300)
  5. assign (@storehere,concat(player(),hug_whenlast))
  6. if(is_null(get_value(concat(player(),hug_whenlast))),
  7. store_value(@storehere,0))
  8. assign(@whenlast,get_value(concat(player(),hug_whenlast)))
  9. if(gt(add(@whenlast, @cooldown), divide(time(), 1000)),
  10. assign(@whennext, subtract(add(@whenlast, @cooldown),divide(time(), 1000)))
  11. die((colorize('&c&lERROR: &4You need to wait '.round(@whennext).' seconds...'))))
  12. store_value(@storehere,divide(time(),1000))
  13. # Runs the command..
  14. broadcast(colorize('&b'.player().' &6has hugged &b'.$player))
  15. }
  16. else {
  17. if($player == '*') {
  18. foreach(@player in all_players()) {
  19. if(@player != player()) {
  20. broadcast(colorize('&b'.player().' &6has hugged &b'.@player))
  21. }
  22. }
  23. }
  24. else{
  25. broadcast(colorize('&b'.player().' &6has hugged &b'.$player))
  26. }
  27. }
  28. <<<
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement