diff options
| author | LNJ <git@lnj.li> | 2017-04-03 13:00:40 +0200 | 
|---|---|---|
| committer | LNJ <git@lnj.li> | 2017-04-05 14:53:16 +0200 | 
| commit | a53dac2929a2e8b4fa8b07840f0bf0f7a9e367b3 (patch) | |
| tree | 20ebd064be3c42017cdc1394e538d8277e30da9e /lua/helpers.lua | |
| parent | 69a974cb6be690ae71d011f5764472e4e0bccc54 (diff) | |
Randomize drop pos
Diffstat (limited to 'lua/helpers.lua')
| -rwxr-xr-x | lua/helpers.lua | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/lua/helpers.lua b/lua/helpers.lua index 87adbae..3662da2 100755 --- a/lua/helpers.lua +++ b/lua/helpers.lua @@ -149,3 +149,13 @@ function drawers.spawn_visual(pos)  		end  	end  end + +function drawers.randomize_pos(pos) +	local rndpos = table.copy(pos) +	local x = math.random(-50, 50) * 0.01 +	local z = math.random(-50, 50) * 0.01 +	rndpos.x = rndpos.x + x +	rndpos.y = rndpos.y + 0.25 +	rndpos.z = rndpos.z + z +	return rndpos +end | 
