Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. function XYZRandomizer2() -- generates a xyz around corpse, put your corpse location here (x,y,z) and put the res radius in r
  2.     -- some way to get your coprse location
  3.     local corpseX = 60;
  4.     local corpseY = 70;
  5.     local resRadius = 20;
  6.  
  7.     -- randomize theta (the angle) and bound the distance to the range of the resRadius
  8.     local randDist = resRadius / math.random(1,100)
  9.     local randTheta = 2*math.pi / math.random(1,100)
  10.     ResTryX, ResTryY = corpseX + randDist*math.cos(randTheta), corpseY + randDist*math.sin(randTheta)
  11.     ToConsole("ResTryX: " .. ResTryX .. " ResTryY: " .. ResTryY);
  12.    
  13. end
  14.  
  15. XYZRandomizer2();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement