Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI( "partTerm" )
- commands.kill( "@e[type=ArmorStand,CustomName=coordfinder]" )
- --make an armor stand for us
- commands.summon( "ArmorStand ~ ~ ~ {Invisible:1b,CustomName:coordfinder,NoGravity:1}" )
- local function getPosition()
- commands.execAsync( "tp @e[type=ArmorStand,CustomName=coordfinder] @p" )
- local ok, result = commands.tp( "@e[type=ArmorStand,CustomName=coordfinder] ~ ~ ~" )
- local x, y, z = result[ 1 ]:match( "to (%S+), (%S+), (%S+)" )
- return tonumber( x ), tonumber( y ), tonumber( z )
- end
- local x, y, z = getPosition()
- local oldX, oldZ = x, z
- local win = partTerm.createWindow( x, y + 3.5, z, 15, 7)
- win.center(false)
- local oldTerm = term.redirect( win )
- paintutils.drawImage(paintutils.loadImage( "flag" ), 1,1 )
- term.redirect(oldTerm)
- parallel.waitForAny(
- function()
- while true do
- local newX, newY, newZ = getPosition()
- if newX ~= x or newZ ~= z then
- oldX, oldY, oldZ = x, y, z
- x, y, z = newX, newY, newZ
- win.setAngles(partTerm.getHorizontalAngle(oldX, oldZ, x, z))
- win.reposition( x, y + 3.5, z )
- elseif newY ~= y then
- y = newY
- win.reposition( x, y + 3.5, z )
- end
- sleep( 0.5 )
- end
- end,
- partTerm.render )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement