Advertisement
King0fGamesYami

Flag

May 31st, 2016
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. os.loadAPI( "commandsPlus" )
  2. os.loadAPI( "partTerm" )
  3. if not commandsPlus then
  4.   error( "Must have commandsPlus installed!", 2 )
  5. elseif not partTerm then
  6.   error( "Must have partTerm installed!", 2 )
  7. end
  8. local image = paintutils.loadImage( ".flag" )
  9.  
  10. local player = commandsPlus.getNearbyPlayers( "10" )[1]
  11. if not player then
  12.   error( "Please move closer to the computer and try again", 2 )
  13. end
  14. local x, y, z = commandsPlus.getPlayerPosition( player )
  15.  
  16. local win = partTerm.createWindow( x, y + 2, z, 49, 13 )
  17. partTerm.setDensity( 150 )
  18. win.center( false )
  19. win.setParticle( "mobSpell" )
  20. local oldTerm = term.redirect( win )
  21. paintutils.drawImage( image, 1, 1 )
  22.  
  23. parallel.waitForAll(
  24.    function()
  25.      while true do
  26.        local x, y, z = commandsPlus.getPlayerPosition( player )
  27.        win.reposition( x, y + 2, z )
  28.      end
  29.    end,
  30.    function()
  31.      while true do
  32.        local a, b = commandsPlus.getPlayerRotation( player )
  33.        win.setAngles( a + 90 )
  34.      end
  35.    end,
  36.    partTerm.render
  37. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement