Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Rainbow Hat
- /rainbowfull [$player] = >>>
- if(!_ismodorup(player())), die('Unknown command. Type "/help" for help.'))
- @player = player()
- if($player != '', @player = player($player))
- if(import('rainbowfull.'.@player) != null) {
- clear_task(import('rainbowfull.'.@player))
- export('rainbowfull.'.@player, null)
- set_pinv(@player, array(103: null))
- set_pinv(@player, array(102: null))
- set_pinv(@player, array(101: null))
- set_pinv(@player, array(100: null))
- die('No more rainbow hat :(')
- }
- msg('Rainbow hat!')
- set_pinv(@player, array(103: array(type: 298)))
- set_pinv(@player, array(102: array(type: 299)))
- set_pinv(@player, array(101: array(type: 300)))
- set_pinv(@player, array(100: array(type: 301)))
- @currentColor = array(0)
- @colors = array(
- array(255, 0, 0), #red
- array(255, 128, 0), #orange
- array(255, 255, 0), #yellow
- array(0, 255, 0), #green
- array(0, 0, 255), #blue
- array(127, 0, 255), #indigo
- array(102, 0, 204) #violet
- )
- @interval = set_interval(200, closure(
- if(!ponline(@player) || pinv(@player, 103)['type'] != 298 || pinv(@player, 102)['type'] != 299 || pinv(@player, 101)['type'] != 300 || pinv(@player, 100)['type'] != 301) {
- clear_task()
- } else {
- @cindex = @currentColor[0]
- @currentColor[0] = if(@currentColor[0] >= array_size(@colors) - 1, 0, @currentColor[0] + 1)
- @color = @colors[@currentColor[0]]
- set_armor_color(@player, 103, @color)
- set_armor_color(@player, 102, @color)
- set_armor_color(@player, 101, @color)
- set_armor_color(@player, 100, @color)
- }
- ))
- export('rainbowhat.'.@player, @interval)
- <<<
Advertisement
Add Comment
Please, Sign In to add comment