add triggers
This commit is contained in:
@@ -3,15 +3,15 @@ local DROP_INIT_VEL = {0, 3, 0}
|
||||
|
||||
function on_hud_open()
|
||||
input.add_callback("player.drop", function ()
|
||||
for i=1,5 do
|
||||
for i=1,80 do
|
||||
local pid = hud.get_player()
|
||||
local pvel = {player.get_vel(pid)}
|
||||
local ppos = vec3.add({player.get_pos(pid)}, {0, 0.7, 0})
|
||||
local throw_force = vec3.mul(vec3.add(player.get_dir(pid),
|
||||
{
|
||||
math.random() - 0.5,
|
||||
math.random() - 0.5,
|
||||
math.random() - 0.5
|
||||
(math.random() - 0.5) * 5,
|
||||
(math.random() - 0.5) * 5,
|
||||
(math.random() - 0.5) * 5
|
||||
}), DROP_FORCE)
|
||||
|
||||
local drop = entity.spawn("base:drop", ppos)
|
||||
|
||||
Reference in New Issue
Block a user