datsexyanon

more cool thing, ok

May 3rd, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1.     function buildFaceCircle(count, radius, basepos)
  2.             if not basePos then
  3.                     basePos = db.actor:position()
  4.                     basePos.y = basePos.y + radius + 1
  5.             end
  6.             local vecDir = db.actor:direction()
  7.             local XZ = vector():set(vecDir.x, 0, vecDir.z)
  8.             local Y = vector():set(0, vecDir.y, 0)
  9.             local vecprime = vector():crossproduct(XZ, Y)
  10.             for x = 1, count do
  11.                     local angle = ( x / count ) * 2 * math.pi
  12.                     local vectorPos = vector():set(vecprime.x * radius * cos(angle), Y.y * radius * sin(angle), vecprime.z * radius * cos(angle))
  13.                     spawnFixed( "procmod_box"..tostring( math.random( 3 ) ), vector():add( vectorPos, basePos ) )
  14.             end
  15.     end
Advertisement
Add Comment
Please, Sign In to add comment