Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Rainbow Hat
- /rainbowhat [$player] = >>>
- if(_nisadmin(player()), die('Unknown command. Type "/help" for help.'))
- @player = player()
- if($player != '', @player = player($player))
- if(import('rainbowhat.'.@player) != null){
- clear_task(import('rainbowhat.'.@player))
- export('rainbowhat.'.@player, null)
- set_pinv(@player, array(103: null))
- die('No more rainbow hat :(')
- }
- msg('Rainbow hat!!!')
- set_pinv(@player, array(103: array(type: 298)))
- @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){
- 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)
- }
- ))
- export('rainbowhat.'.@player, @interval)
- <<<
Advertisement
Add Comment
Please, Sign In to add comment