Mathilde411

Kill boubech

Nov 14th, 2020 (edited)
1,120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local ni = peripheral.wrap("back")
  2. local R2D = 180/math.pi
  3. while true do
  4.     local b = ni.getMetaByName("boubechcraft")
  5.     if b then
  6.         local d = math.sqrt(b.x*b.x + b.z*b.z)
  7.         local nz = b.z/d
  8.         local theta = R2D*math.acos(nz)
  9.         if b.x > 0 then
  10.             theta = (-theta)%360
  11.         end
  12.  
  13.         local ny = b.y/d
  14.         local phi = -R2D*math.asin(ny)
  15.  
  16.         ni.fire(theta, phi, 0.5)
  17.     end
  18.  
  19.     sleep(0)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment