Nessiesson

rainbowfull

Aug 30th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #Rainbow Hat
  2. /rainbowfull [$player] = >>>
  3. if(!_ismodorup(player())), die('Unknown command. Type "/help" for help.'))
  4. @player = player()
  5. if($player != '', @player = player($player))
  6. if(import('rainbowfull.'.@player) != null) {
  7. clear_task(import('rainbowfull.'.@player))
  8. export('rainbowfull.'.@player, null)
  9. set_pinv(@player, array(103: null))
  10. set_pinv(@player, array(102: null))
  11. set_pinv(@player, array(101: null))
  12. set_pinv(@player, array(100: null))
  13. die('No more rainbow hat :(')
  14. }
  15. msg('Rainbow hat!')
  16. set_pinv(@player, array(103: array(type: 298)))
  17. set_pinv(@player, array(102: array(type: 299)))
  18. set_pinv(@player, array(101: array(type: 300)))
  19. set_pinv(@player, array(100: array(type: 301)))
  20. @currentColor = array(0)
  21. @colors = array(
  22. array(255, 0, 0), #red
  23. array(255, 128, 0), #orange
  24. array(255, 255, 0), #yellow
  25. array(0, 255, 0), #green
  26. array(0, 0, 255), #blue
  27. array(127, 0, 255), #indigo
  28. array(102, 0, 204) #violet
  29. )
  30. @interval = set_interval(200, closure(
  31. if(!ponline(@player) || pinv(@player, 103)['type'] != 298 || pinv(@player, 102)['type'] != 299 || pinv(@player, 101)['type'] != 300 || pinv(@player, 100)['type'] != 301) {
  32. clear_task()
  33. } else {
  34. @cindex = @currentColor[0]
  35. @currentColor[0] = if(@currentColor[0] >= array_size(@colors) - 1, 0, @currentColor[0] + 1)
  36. @color = @colors[@currentColor[0]]
  37. set_armor_color(@player, 103, @color)
  38. set_armor_color(@player, 102, @color)
  39. set_armor_color(@player, 101, @color)
  40. set_armor_color(@player, 100, @color)
  41. }
  42. ))
  43. export('rainbowhat.'.@player, @interval)
  44. <<<
Advertisement
Add Comment
Please, Sign In to add comment